/* =========================================================
   片刻解压 · styles
   ========================================================= */
:root {
  --bg-0: #070b19;
  --bg-1: #0b1022;
  --bg-2: #141a36;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.1);
  --stroke: rgba(255, 255, 255, 0.1);
  --text: #eef0ff;
  --text-2: rgba(226, 230, 255, 0.68);
  --text-3: rgba(226, 230, 255, 0.42);
  --lav: #a78bfa;
  --indigo: #818cf8;
  --teal: #5eead4;
  --sky: #7dd3fc;
  --peach: #fda4af;
  --amber: #fcd34d;
  --radius: 22px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --topbar-h: 56px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg-1);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

body { position: fixed; inset: 0; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--lav); outline-offset: 2px; }

canvas { display: block; touch-action: none; }

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, #1e2450 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}

/* ---------- views ---------- */
.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 14px, 0) scale(.985);
  transition: opacity .38s var(--ease-out), transform .45s var(--ease-out), visibility 0s linear .45s;
  will-change: opacity, transform;
  contain: layout paint;
}
.view.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity .38s var(--ease-out), transform .45s var(--ease-out), visibility 0s;
}
.view-home:not(.is-active) { transform: translate3d(0, 0, 0) scale(.96); }

/* ---------- home ---------- */
.view-home {
  padding: calc(var(--sat) + 18px) calc(var(--sar) + 18px) calc(var(--sab) + 12px) calc(var(--sal) + 18px);
  gap: 14px;
}
.home-glow {
  position: absolute;
  inset: -20% -30% auto;
  height: 70%;
  background:
    radial-gradient(40% 45% at 25% 40%, rgba(129, 140, 248, .35), transparent 70%),
    radial-gradient(35% 40% at 80% 30%, rgba(94, 234, 212, .18), transparent 70%),
    radial-gradient(30% 35% at 60% 70%, rgba(244, 114, 182, .14), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  animation: glowDrift 18s ease-in-out infinite alternate;
}
@keyframes glowDrift {
  from { transform: translate3d(-4%, 0, 0) rotate(0deg); }
  to   { transform: translate3d(4%, 3%, 0) rotate(8deg); }
}
.home-header {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 8px 4px 4px;
}
.brand-mark { grid-row: 1 / 3; width: 52px; height: 52px; filter: drop-shadow(0 6px 18px rgba(129, 140, 248, .55)); animation: float 5s ease-in-out infinite; }
.brand-mark svg { width: 100%; height: 100%; }
@keyframes float { 50% { transform: translateY(-4px); } }
.home-title {
  margin: 0;
  font-size: clamp(26px, 7.5vw, 34px);
  font-weight: 700;
  letter-spacing: .04em;
  background: linear-gradient(90deg, #fff, #c7d2fe 60%, #a5f3fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.home-sub { margin: 2px 0 0; color: var(--text-2); font-size: 15px; letter-spacing: .06em; }

.cards {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 6px;
}
.card {
  --c1: #6366f1;
  --c2: #312e81;
  position: relative;
  flex: 1 1 0;
  min-height: 76px;
  max-height: 150px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 12px 12px;
  text-align: left;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c1) 38%, transparent), transparent 60%),
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  overflow: hidden;
  transform: translateZ(0);
  transition: transform .25s var(--ease-spring), box-shadow .25s, background-color .25s;
  opacity: 0;
  animation: cardIn .6s var(--ease-out) forwards;
}
.card:nth-child(1) { animation-delay: .04s; }
.card:nth-child(2) { animation-delay: .1s; }
.card:nth-child(3) { animation-delay: .16s; }
.card:nth-child(4) { animation-delay: .22s; }
@keyframes cardIn { from { opacity: 0; transform: translate3d(0, 16px, 0); } to { opacity: 1; transform: none; } }
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(60% 120% at var(--px, 50%) var(--py, 50%), rgba(255,255,255,.18), transparent 60%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.card.is-pressed { transform: scale(.97); }
.card.is-pressed::after { opacity: 1; transition: opacity .05s; }
.card-pop    { --c1: #22d3ee; }
.card-sand   { --c1: #f472b6; }
.card-smash  { --c1: #fb923c; }
.card-breathe{ --c1: #818cf8; }
.card-art {
  flex: none;
  width: clamp(58px, 17vw, 76px);
  aspect-ratio: 1;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c1) 35%, #0b1022), rgba(10, 14, 34, .8));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 8px 20px -10px var(--c1);
}
.card-art svg { width: 82%; height: 82%; overflow: visible; }
.spin-mini { animation: spin 3.2s linear infinite; transform-origin: 0 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.breath-mini { animation: breathMini 6s ease-in-out infinite; transform-origin: 40px 40px; }
@keyframes breathMini { 0%,100% { transform: scale(.7); opacity: .7; } 50% { transform: scale(1); opacity: 1; } }
.card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card-title { font-size: 19px; font-weight: 650; letter-spacing: .03em; }
.card-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.4; }
.card-chev { font-size: 28px; color: var(--text-3); font-weight: 300; line-height: 1; }

.home-foot { display: flex; justify-content: center; padding-top: 2px; }
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  transition: transform .2s var(--ease-spring), color .2s;
}
.sound-toggle:active { transform: scale(.95); }
.sound-ico {
  width: 18px; height: 18px;
  background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 9h4l5-4v14l-5-4H4z"/><path d="M16 8.5a4.5 4.5 0 010 7M18.5 6a8 8 0 010 12" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 9h4l5-4v14l-5-4H4z"/><path d="M16 8.5a4.5 4.5 0 010 7M18.5 6a8 8 0 010 12" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"/></svg>') center/contain no-repeat;
}
.sound-toggle.is-muted .sound-ico {
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 9h4l5-4v14l-5-4H4z"/><path d="M16.5 9.5l5 5M21.5 9.5l-5 5" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"/></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 9h4l5-4v14l-5-4H4z"/><path d="M16.5 9.5l5 5M21.5 9.5l-5 5" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"/></svg>');
}

/* ---------- top bar ---------- */
.topbar {
  position: relative;
  z-index: 5;
  flex: none;
  display: grid;
  grid-template-columns: minmax(88px, auto) 1fr minmax(88px, auto);
  align-items: center;
  gap: 8px;
  height: calc(var(--topbar-h) + var(--sat));
  padding: var(--sat) calc(var(--sar) + 10px) 0 calc(var(--sal) + 10px);
}
.topbar-float {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: linear-gradient(180deg, rgba(7, 11, 25, .75), rgba(7, 11, 25, 0));
  pointer-events: none;
}
.topbar-float > * { pointer-events: auto; }
.topbar-title {
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-spacer { display: block; }
.topbar > :last-child { justify-self: end; }
.back-btn {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px 0 8px;
  border-radius: 999px;
  font-size: 15px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform .2s var(--ease-spring), background .2s;
}
.back-btn:active { transform: scale(.93); background: rgba(255, 255, 255, .14); }
.back-ico {
  width: 20px; height: 20px;
  background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 5l-7 7 7 7" fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 5l-7 7 7 7" fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>') center/contain no-repeat;
}
.icon-btn {
  width: 44px; height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .08);
  transition: transform .2s var(--ease-spring), opacity .2s;
}
.icon-btn:active { transform: scale(.9); }
.icon-btn.is-off { opacity: .45; }
.bell {
  width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 16V11a6 6 0 0112 0v5l1.5 2h-15z"/><path d="M10 20a2 2 0 004 0"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 16V11a6 6 0 0112 0v5l1.5 2h-15z"/><path d="M10 20a2 2 0 004 0"/></svg>') center/contain no-repeat;
}

/* ---------- shared controls ---------- */
.pill-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #0b1022;
  background: linear-gradient(180deg, #f5f3ff, #c7d2fe);
  box-shadow: 0 6px 18px -6px rgba(167, 139, 250, .7), inset 0 1px 0 #fff;
  transition: transform .2s var(--ease-spring), filter .2s;
}
.pill-btn:active { transform: scale(.93); filter: brightness(.95); }
.pill-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: none;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.pill-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  min-width: 132px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: .1em;
  color: #0b1022;
  background: linear-gradient(180deg, #e0e7ff, #a5b4fc);
  box-shadow: 0 12px 30px -10px rgba(129, 140, 248, .9), inset 0 1px 0 #fff;
  transition: transform .22s var(--ease-spring), filter .2s;
}
.primary-btn:active { transform: scale(.94); }
.primary-wide { width: 100%; }
.play-ico {
  width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 4.5v15a1 1 0 001.5.86l12-7.5a1 1 0 000-1.72l-12-7.5A1 1 0 007 4.5z"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 4.5v15a1 1 0 001.5.86l12-7.5a1 1 0 000-1.72l-12-7.5A1 1 0 007 4.5z"/></svg>') center/contain no-repeat;
}
.is-running .play-ico {
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="6" y="4" width="4.5" height="16" rx="1.5"/><rect x="13.5" y="4" width="4.5" height="16" rx="1.5"/></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="6" y="4" width="4.5" height="16" rx="1.5"/><rect x="13.5" y="4" width="4.5" height="16" rx="1.5"/></svg>');
}
.stat { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; letter-spacing: .04em; white-space: nowrap; }
.stat-dim { color: var(--text-3); }

.bottom-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 8px calc(var(--sar) + 18px) calc(var(--sab) + 10px) calc(var(--sal) + 18px);
}

/* segmented control */
.seg {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 2px calc(var(--sar) + 18px) 8px calc(var(--sal) + 18px);
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--stroke);
}
.seg-btn {
  position: relative;
  z-index: 1;
  min-height: 40px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .08em;
  transition: color .3s;
}
.seg-btn.is-active { color: #0b1022; }
.seg-thumb {
  position: absolute;
  top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: linear-gradient(180deg, #f5f3ff, #c7d2fe);
  box-shadow: 0 4px 14px -4px rgba(167, 139, 250, .8);
  transition: transform .4s var(--ease-spring);
}
.seg[data-active="spinner"] .seg-thumb { transform: translateX(100%); }

.pane { flex: 1; min-height: 0; display: none; flex-direction: column; }
.pane.is-active { display: flex; animation: paneIn .35s var(--ease-out); }
@keyframes paneIn { from { opacity: 0; transform: translate3d(0, 8px, 0); } }

/* ---------- bubble wrap ---------- */
.bubble-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 calc(var(--sar) + 12px) 0 calc(var(--sal) + 12px);
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 30% 0%, rgba(165, 243, 252, .16), transparent 60%),
    linear-gradient(160deg, rgba(125, 211, 252, .12), rgba(99, 102, 241, .08));
  border: 1px solid rgba(186, 230, 253, .14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 20px 40px -20px rgba(0,0,0,.7);
  touch-action: none;
}
.bubble-sheet { position: absolute; inset: 0; touch-action: none; }
.bubble {
  position: absolute;
  left: 0; top: 0;
  width: var(--bs);
  height: var(--bs);
  border-radius: 50%;
  touch-action: none;
  transform: var(--pos);
  will-change: transform;
}
.bubble::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.95) 0 7%, rgba(255,255,255,.45) 12%, transparent 26%),
    radial-gradient(circle at 68% 74%, rgba(255,255,255,.22), transparent 30%),
    radial-gradient(circle at 50% 50%, rgba(186, 230, 253, .14) 0 52%, rgba(125, 211, 252, .32) 66%, rgba(224, 242, 254, .65) 72%, rgba(56, 189, 248, .15) 74%, transparent 75%);
  box-shadow:
    0 6px 10px -4px rgba(0, 0, 0, .45),
    inset 0 -6px 10px rgba(14, 116, 144, .35),
    inset 0 4px 8px rgba(255, 255, 255, .25);
  transition: transform .18s var(--ease-out), opacity .2s, box-shadow .2s, background .2s;
}
.bubble::after {
  /* popped wrinkled film */
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  opacity: 0;
  background:
    conic-gradient(from 20deg, rgba(255,255,255,.12), rgba(255,255,255,0) 12%, rgba(255,255,255,.16) 22%, rgba(255,255,255,0) 36%, rgba(255,255,255,.1) 52%, rgba(255,255,255,0) 66%, rgba(255,255,255,.14) 80%, rgba(255,255,255,0));
  border: 1px solid rgba(186, 230, 253, .25);
  transform: scale(.9) rotate(var(--rot, 0deg));
  transition: opacity .25s, transform .25s var(--ease-out);
}
.bubble.is-down::before { transform: scale(.9, .86); }
.bubble.is-popped::before {
  transform: scale(.78);
  opacity: .25;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.35);
  background: radial-gradient(circle at 50% 50%, rgba(186, 230, 253, .08) 0 60%, rgba(125, 211, 252, .2) 72%, transparent 74%);
}
.bubble.is-popped::after { opacity: 1; transform: scale(.82) rotate(var(--rot, 0deg)); }
.bubble.pop-anim { animation: popBounce .42s var(--ease-out); }
@keyframes popBounce {
  0% { transform: var(--pos) scale(1.12); }
  35% { transform: var(--pos) scale(.84); }
  65% { transform: var(--pos) scale(1.04); }
  100% { transform: var(--pos) scale(1); }
}
.bubble.reinflate::before { animation: reinflate .55s var(--ease-spring) both; animation-delay: var(--delay, 0s); }
@keyframes reinflate { 0% { transform: scale(.7); opacity: .3; } 100% { transform: scale(1); opacity: 1; } }

.fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fx-ring {
  position: absolute;
  left: 0; top: 0;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  border: 2px solid rgba(224, 242, 254, .9);
  box-shadow: 0 0 12px rgba(125, 211, 252, .8);
  animation: ring .45s var(--ease-out) forwards;
}
@keyframes ring { from { transform: var(--p) scale(.6); opacity: 1; } to { transform: var(--p) scale(var(--s, 6)); opacity: 0; } }
.fx-flash {
  position: absolute;
  left: 0; top: 0;
  width: 40px; height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.95), rgba(186,230,253,.5) 40%, transparent 70%);
  animation: flash .28s ease-out forwards;
  mix-blend-mode: screen;
}
@keyframes flash { from { transform: var(--p) scale(.4); opacity: 1; } to { transform: var(--p) scale(1.6); opacity: 0; } }
.fx-dot {
  position: absolute;
  left: 0; top: 0;
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: #e0f2fe;
  box-shadow: 0 0 6px #7dd3fc;
  animation: dot .5s var(--ease-out) forwards;
}
@keyframes dot { from { transform: var(--p) scale(1); opacity: 1; } to { transform: var(--p2) scale(.2); opacity: 0; } }

/* ---------- spinner ---------- */
.spinner-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  touch-action: none;
}
.spinner-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.spinner-hint, .sand-hint, .smash-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--text-2);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--stroke);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .6s, transform .6s var(--ease-out);
}
.is-hidden-hint { opacity: 0 !important; transform: translate(-50%, 8px) !important; }
.swatches { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: nowrap; }
.swatch {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: transform .25s var(--ease-spring);
}
.swatch::before {
  content: "";
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.25), inset 0 2px 3px rgba(255,255,255,.35), 0 4px 10px -3px var(--glow, rgba(0,0,0,.4));
  transition: transform .25s var(--ease-spring);
}
.swatch::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9);
  opacity: 0;
  transform: scale(.8);
  transition: opacity .2s, transform .3s var(--ease-spring);
}
.swatch.is-active::after { opacity: 1; transform: scale(1); }
.swatch.is-active::before { transform: scale(.82); }
.swatch:active { transform: scale(.88); }
.swatches-sm { gap: 2px; }
.swatches-sm .swatch { width: 40px; height: 44px; }
.swatches-sm .swatch::before { width: 24px; height: 24px; }
.swatches-sm .swatch::after { inset: 6px 4px; }

/* ---------- sand ---------- */
.view-sand { background: radial-gradient(120% 70% at 50% 0%, #1a1440, #0a0c1c 70%); }
.sand-stage { position: absolute; inset: 0; touch-action: none; }
.sand-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sand-stage::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: var(--fy, 100%);
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(0,0,0,.25));
  border-top: 1px solid rgba(255,255,255,.08);
  pointer-events: none;
}
#sand-settled { transition: opacity .7s ease, transform .9s cubic-bezier(.5, 0, .75, 0), filter .7s; }
#sand-settled.is-draining { opacity: 0; transform: translate3d(0, 30%, 0); filter: blur(4px); }
.sand-hint { top: 50%; bottom: auto; transform: translate(-50%, -50%); }
.sand-hint.is-hidden-hint { transform: translate(-50%, -40%) !important; }
.sand-palette {
  position: absolute;
  left: 50%;
  bottom: calc(var(--sab) + 12px);
  transform: translateX(-50%);
  max-width: calc(100% - 20px - var(--sal) - var(--sar));
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(14, 16, 36, .55);
  border: 1px solid rgba(255,255,255,.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  z-index: 4;
}
.sand-palette .swatches { gap: 0; }
@media (max-width: 380px) {
  .sand-palette .swatch { width: 38px; }
  .sand-palette .swatch::before { width: 26px; height: 26px; }
  .sand-palette .swatch::after { inset: 4px 1px; }
}

/* ---------- smash ---------- */
.view-smash { background: radial-gradient(110% 70% at 50% 20%, #2a1d3d, #100c1c 70%); }
.smash-stage { position: absolute; inset: 0; touch-action: none; }
.smash-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.smash-hint { bottom: calc(var(--sab) + 140px); }
.smash-name {
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--sat) + var(--topbar-h) + 50px);
  text-align: center;
  font-size: 14px;
  letter-spacing: .3em;
  color: var(--text-3);
  pointer-events: none;
  transition: opacity .4s;
}
.smash-count {
  justify-self: end;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.smash-count.bump { animation: bump .35s var(--ease-spring); }
@keyframes bump { 40% { transform: scale(1.25); color: #fed7aa; } }

/* 怒气槽 */
.smash-hud {
  position: absolute;
  z-index: 4;
  left: calc(var(--sal) + 16px);
  right: calc(var(--sar) + 12px);
  top: calc(var(--sat) + var(--topbar-h) + 2px);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.rage-label { font-size: 12px; letter-spacing: .2em; color: var(--text-3); white-space: nowrap; transition: color .3s; }
.rage-track {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
}
.rage-fill {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: scaleX(var(--rage, 0));
  background: linear-gradient(90deg, #fb923c, #f43f5e 70%, #e11d48);
  border-radius: 5px;
  transition: transform .3s var(--ease-out);
}
.rage-btn {
  pointer-events: auto;
  flex: none;
  min-width: 64px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2em;
  color: rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  transition: transform .25s var(--ease-spring), background .3s, color .3s, box-shadow .3s;
}
.rage-btn:active { transform: scale(.92); }
.smash-hud.is-ready .rage-label { color: #fda4af; }
.smash-hud.is-ready .rage-fill { animation: rageGlow .7s ease-in-out infinite alternate; }
.smash-hud.is-ready .rage-btn {
  color: #fff;
  background: linear-gradient(180deg, #fb7185, #e11d48);
  border-color: transparent;
  box-shadow: 0 6px 22px -4px rgba(244, 63, 94, .9);
  animation: ragePulse .9s ease-in-out infinite;
}
.smash-hud.nudge .rage-track { animation: nudge .35s ease; }
@keyframes rageGlow { from { filter: brightness(1); } to { filter: brightness(1.45) saturate(1.3); } }
@keyframes ragePulse { 50% { transform: scale(1.07); } }
@keyframes nudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* 连击 */
.smash-combo {
  position: absolute;
  right: calc(var(--sar) + 16px);
  top: calc(var(--sat) + var(--topbar-h) + 50px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px) scale(.9);
  transition: opacity .25s, transform .3s var(--ease-out);
}
.smash-combo.is-show { opacity: 1; transform: none; }
.smash-combo b {
  font-size: 34px;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  letter-spacing: .02em;
  color: #fde68a;
  text-shadow: 0 2px 0 #b45309, 0 0 18px rgba(251, 191, 36, .55);
  font-variant-numeric: tabular-nums;
}
.smash-combo span { font-size: 12px; letter-spacing: .3em; color: #fed7aa; margin-top: 2px; }
.smash-combo.tier-1 b { color: #fdba74; text-shadow: 0 2px 0 #c2410c, 0 0 22px rgba(249, 115, 22, .7); }
.smash-combo.tier-2 b { color: #fda4af; text-shadow: 0 2px 0 #be123c, 0 0 26px rgba(244, 63, 94, .8); }
.smash-combo.tier-3 b { color: #f0abfc; text-shadow: 0 2px 0 #a21caf, 0 0 30px rgba(217, 70, 239, .9); }
.smash-combo.bump b { animation: comboBump .32s var(--ease-spring); }
@keyframes comboBump { 0% { transform: scale(1.6) rotate(-6deg); } 100% { transform: none; } }

/* 底部工具栏 */
.smash-dock {
  position: absolute;
  z-index: 4;
  left: calc(var(--sal) + 10px);
  right: calc(var(--sar) + 10px);
  bottom: calc(var(--sab) + 10px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border-radius: 24px;
  background: rgba(18, 14, 34, .62);
  border: 1px solid rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 -10px 30px -16px rgba(0, 0, 0, .7);
}
.smash-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tool-btn {
  min-height: 50px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: transform .25s var(--ease-spring), background .25s, color .25s, border-color .25s, box-shadow .25s;
}
.tool-btn svg { width: 22px; height: 22px; }
.tool-btn:active { transform: scale(.9); }
.tool-btn.is-active {
  color: #fff;
  background: linear-gradient(160deg, rgba(251, 146, 60, .38), rgba(244, 63, 94, .22));
  border-color: rgba(253, 186, 116, .45);
  box-shadow: 0 6px 18px -8px rgba(251, 146, 60, .9);
}
.smash-actions { display: grid; grid-template-columns: 1fr 1fr 1fr 1.3fr; gap: 6px; }
.smash-actions .pill-btn { min-height: 44px; padding: 0 4px; font-size: 14px; letter-spacing: .04em; white-space: nowrap; }
#smash-write-btn.has-text { color: #fda4af; border-color: rgba(253, 164, 175, .4); }

/* 写字面板 */
.smash-sheet {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  background: rgba(5, 6, 16, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility 0s linear .3s;
}
.smash-sheet.is-open { opacity: 1; visibility: visible; transition: opacity .25s; }
.smash-sheet-card {
  width: 100%;
  padding: 16px calc(var(--sar) + 16px) calc(var(--sab) + 14px) calc(var(--sal) + 16px);
  border-radius: 26px 26px 0 0;
  background: rgba(30, 22, 50, .97);
  border-top: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 -20px 50px -10px rgba(0, 0, 0, .6);
  transform: translate3d(0, 100%, 0);
  transition: transform .35s var(--ease-out);
}
.smash-sheet.is-open .smash-sheet-card { transform: translate3d(0, calc(-1 * var(--kb, 0px)), 0); }
.smash-sheet-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.smash-sheet-head h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: .08em; }
.smash-sheet-count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.smash-input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  outline: none;
  caret-color: #fb923c;
  -webkit-appearance: none;
  appearance: none;
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
  touch-action: manipulation;
}
.smash-input::placeholder { color: var(--text-3); }
.smash-input:focus { border-color: rgba(251, 146, 60, .65); box-shadow: 0 0 0 3px rgba(251, 146, 60, .15); }
.smash-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.smash-preset {
  min-height: 44px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  transition: transform .2s var(--ease-spring), background .2s;
}
.smash-preset:active { transform: scale(.93); background: rgba(251, 146, 60, .25); }
.smash-sheet-note { margin: 6px 2px 10px; font-size: 12px; color: var(--text-3); }
.smash-sheet-btns { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }

@media (max-height: 700px) {
  .tool-btn { min-height: 46px; }
  .tool-btn svg { width: 20px; height: 20px; }
  .smash-combo b { font-size: 28px; }
  .smash-hint { bottom: calc(var(--sab) + 130px); }
}

/* ---------- smash：定制照片（高级版）+ 绝密档案界面 ---------- */
.smash-photo-btn { position: relative; }
.prem-badge {
  position: absolute;
  top: -5px; right: -3px;
  padding: 1px 5px;
  border-radius: 6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .08em;
  color: #1c1007;
  background: linear-gradient(180deg, #fcd34d, #f59e0b);
  box-shadow: 0 2px 6px rgba(245, 158, 11, .5);
  pointer-events: none;
}
.smash-photo-btn.is-custom { color: #fcd34d; border-color: rgba(252, 211, 77, .45); }

.spy {
  --mono: "SF Mono", ui-monospace, Menlo, "Courier New", "PingFang SC", monospace;
  --amber: #f5b342;
  --red: #dc2626;
  --paper: #e9e2d0;
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  background: radial-gradient(120% 90% at 50% 40%, #16140f 0%, #0a0907 70%, #050404 100%);
  color: #e8e2d2;
  overflow: hidden;
}
.spy.is-open { display: block; animation: spyIn .28s ease; }
@keyframes spyIn { from { opacity: 0; } }
.spy-grain, .spy-scan { position: absolute; inset: -20px; pointer-events: none; z-index: 2; }
.spy-grain {
  opacity: .16;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(4) infinite;
}
@keyframes grain { 25% { transform: translate(-8px, 6px); } 50% { transform: translate(6px, -4px); } 75% { transform: translate(-4px, -8px); } }
.spy-scan {
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px),
    radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0,0,0,.6) 100%);
}
.spy-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: -10px; top: 0; }
.spy-panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--sat) + 14px) calc(var(--sar) + 14px) calc(var(--sab) + 14px) calc(var(--sal) + 14px);
}
.spy-panel.is-active { display: flex; animation: panelIn .3s var(--ease-out); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } }

/* 档案夹 */
.dossier {
  position: relative;
  width: min(100%, 400px);
  max-height: 100%;
  padding: 26px 18px 16px;
  border-radius: 6px 14px 14px 14px;
  background:
    repeating-linear-gradient(90deg, rgba(245,179,66,.18) 0 1px, transparent 1px 12px) top / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, rgba(245,179,66,.18) 0 1px, transparent 1px 12px) bottom / 100% 5px no-repeat,
    linear-gradient(170deg, #241f16, #15120d);
  border: 1px solid rgba(245, 179, 66, .28);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.9), inset 0 0 0 4px rgba(0,0,0,.25);
}
.dossier-tab {
  position: absolute;
  top: -15px; left: -1px;
  padding: 4px 12px 3px;
  border-radius: 6px 6px 0 0;
  font: 600 11px/1.4 var(--mono);
  letter-spacing: .14em;
  color: #1a1309;
  background: var(--amber);
}
.tab-inline { position: static; border-radius: 4px; }
.stamp {
  position: absolute;
  top: 12px; right: 14px;
  padding: 2px 10px;
  border: 3px solid var(--red);
  border-radius: 6px;
  font: 900 22px/1.1 "PingFang SC", "Noto Sans SC", sans-serif;
  letter-spacing: .25em;
  color: var(--red);
  transform: rotate(-12deg);
  opacity: .82;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 55%, rgba(0,0,0,.55) 75%, #000 90%);
  mask-image: radial-gradient(circle at 30% 40%, #000 55%, rgba(0,0,0,.55) 75%, #000 90%);
  pointer-events: none;
}
.stamp-sm { font-size: 15px; padding: 1px 7px; border-width: 2px; }
.spy-kicker { margin: 0; font: 12px/1.4 var(--mono); letter-spacing: .14em; color: var(--amber); }
.spy-title { margin: 4px 0 10px; font-size: 24px; font-weight: 800; letter-spacing: .1em; color: #f8f1df; }
.spy-list { margin: 0 0 12px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.spy-list li { position: relative; padding-left: 18px; font-size: 13.5px; line-height: 1.5; color: #d8d0bd; }
.spy-list li::before { content: "▸"; position: absolute; left: 0; color: var(--amber); }
.spy-list b { color: #fff4d6; }
.spy-price { display: flex; align-items: baseline; gap: 10px; padding: 8px 0 4px; border-top: 1px dashed rgba(245,179,66,.3); }
.spy-price b { font: 800 26px/1 var(--mono); color: #fcd34d; }
.spy-price span { font-size: 12px; color: #b9b09b; }
.spy-msg { min-height: 1.2em; margin: 4px 0; font: 12px/1.5 var(--mono); color: #fca5a5; }
.spy-actions { display: flex; flex-direction: column; gap: 8px; }
.spy-row { display: flex; gap: 8px; width: 100%; }
.spy-row > * { flex: 1; }
.spy-btn {
  min-height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  transition: transform .2s var(--ease-spring), filter .2s, background .2s;
}
.spy-btn:active { transform: scale(.96); }
.spy-btn:disabled { opacity: .45; }
.spy-primary { color: #1a1309; background: linear-gradient(180deg, #fcd34d, #f59e0b); box-shadow: 0 8px 20px -8px rgba(245,158,11,.8); }
.spy-test { color: #fde68a; background: rgba(245,179,66,.08); border: 1px dashed rgba(245,179,66,.65); }
.spy-ghost { color: #e8e2d2; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.spy-danger { color: #fff; background: linear-gradient(180deg, #ef4444, #b91c1c); }
.spy-fine { margin: -2px 0 2px; font-size: 11.5px; line-height: 1.5; color: #a39a86; text-align: center; }
.spy-link { min-height: 44px; padding: 0 8px; font: 13px var(--mono); color: #b9b09b; text-decoration: underline; text-underline-offset: 3px; }
.spy-link-danger { color: #fca5a5; }
.spy-hint { margin: 14px 0 0; font: 11px var(--mono); letter-spacing: .2em; color: #7d7564; text-align: center; }

/* 简报 */
.brief {
  position: relative;
  width: min(100%, 400px);
  min-height: 260px;
  padding: 20px 18px;
  border: 1px solid rgba(245,179,66,.3);
  border-radius: 10px;
  background: rgba(10, 9, 6, .85);
  cursor: pointer;
}
.brief-head, .term-head { display: flex; align-items: center; gap: 8px; font: 12px var(--mono); letter-spacing: .14em; color: var(--amber); }
.led { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; animation: blink 1.4s steps(2) infinite; }
.led-red { background: var(--red); box-shadow: 0 0 8px var(--red); }
@keyframes blink { 50% { opacity: .3; } }
.typer {
  margin: 18px 0 0;
  white-space: pre-wrap;
  font: 15px/1.9 var(--mono);
  color: #f3e9cf;
  text-shadow: 0 0 6px rgba(245,179,66,.35);
  min-height: 9em;
}
.typer::after { content: "▌"; color: var(--amber); animation: blink 1s steps(2) infinite; }

/* PIN 终端 */
.terminal {
  position: relative;
  width: min(100%, 360px);
  padding: 16px 16px 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(20,24,18,.96), rgba(8,10,8,.96));
  border: 1px solid rgba(134, 239, 172, .22);
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 60px -20px rgba(0,0,0,.9), inset 0 0 40px rgba(34,197,94,.06);
  overflow: hidden;
}
.terminal .term-head { color: #86efac; }
.term-sub { margin: 8px 0 12px; font: 12.5px/1.6 var(--mono); color: #a8b5a2; min-height: 2.2em; }
.pin-field { display: flex; justify-content: center; gap: 8px; margin-bottom: 6px; }
.pin-cell {
  width: 38px; height: 48px;
  display: grid; place-items: center;
  border-radius: 6px;
  border: 1px solid rgba(134,239,172,.3);
  background: rgba(0,0,0,.45);
  font: 700 20px var(--mono);
  color: #bbf7d0;
  transition: border-color .2s, background .2s;
}
.pin-cell.is-filled { border-color: rgba(134,239,172,.8); background: rgba(34,197,94,.1); }
.pin-cell.is-filled::after { content: "●"; font-size: 16px; animation: cellIn .18s var(--ease-spring); }
.pin-cell.is-cursor { border-color: #86efac; box-shadow: 0 0 0 2px rgba(134,239,172,.2); }
.pin-cell.is-cursor::after { content: "_"; animation: blink 1s steps(2) infinite; }
@keyframes cellIn { from { transform: scale(1.8); opacity: 0; } }
.pin-msg { min-height: 1.5em; margin: 2px 0 8px; text-align: center; font: 12.5px var(--mono); color: #86efac; }
.pin-msg.is-warn { color: #fca5a5; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.key {
  height: 54px;
  border-radius: 10px;
  font: 600 24px var(--mono);
  color: #e7ffe9;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
  transition: transform .12s, background .12s;
}
.key:active { transform: scale(.94); background: rgba(134,239,172,.18); }
.key-fn { font-size: 15px; letter-spacing: .1em; }
.key-ok { color: #052e16; background: linear-gradient(180deg, #86efac, #22c55e); }
.key:disabled { opacity: .35; }
.term-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.terminal.is-fail { animation: termFail .45s; }
.terminal.is-fail .pin-cell { border-color: var(--red); background: rgba(220,38,38,.18); }
@keyframes termFail {
  0% { box-shadow: 0 0 0 2px rgba(220,38,38,.9), inset 0 0 60px rgba(220,38,38,.45); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}
.bolt { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.bolt span {
  position: absolute; left: 0; right: 0; top: 0; height: 26%;
  background: linear-gradient(180deg, transparent, rgba(134,239,172,.25) 70%, rgba(187,247,208,.9) 98%, transparent);
}
.terminal.is-ok .bolt { animation: boltFade .7s ease forwards; }
.terminal.is-ok .bolt span { animation: scanDown .7s ease-in forwards; }
.terminal.is-ok .pin-cell { border-color: #86efac; background: rgba(34,197,94,.25); }
@keyframes boltFade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes scanDown { from { transform: translateY(-100%); } to { transform: translateY(400%); } }
.terminal-confirm { width: min(100%, 360px); padding-bottom: 14px; border-color: rgba(220,38,38,.35); }
.terminal-confirm .term-head { color: #fca5a5; }
.confirm-text { margin: 12px 0 14px; font-size: 14px; line-height: 1.7; color: #e5ded0; }

/* 私密空间相册 */
.dossier-wide { width: min(100%, 420px); }
.vault-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 0 10px; padding-right: 70px; }
.vault-head h3 { margin: 0; font-size: 18px; letter-spacing: .12em; }
.vault-head span { font: 12px var(--mono); color: var(--amber); }
.vault-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.vault-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: #0d0b08;
  border: 1px solid rgba(245,179,66,.25);
}
.vault-tile img { width: 100%; height: 100%; object-fit: cover; display: block; filter: sepia(.15) contrast(1.05); -webkit-user-drag: none; }
.vault-tile .tile-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 3px 6px;
  font: 10.5px var(--mono);
  letter-spacing: .06em;
  color: #fff4d6;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.75));
  text-align: left;
}
.vault-del {
  position: absolute; top: 0; right: 0;
  width: 44px; height: 44px;
  display: grid; place-items: center;
}
.vault-del::before {
  content: "×";
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 17px; line-height: 1;
  color: #fff;
  background: rgba(185,28,28,.85);
}
.vault-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-style: dashed;
  color: var(--amber);
  font-size: 13px; font-weight: 700; letter-spacing: .08em;
}
.vault-add b { font-size: 26px; line-height: 1; font-weight: 400; }
.vault-add small { font-size: 10.5px; color: #a39a86; font-weight: 400; letter-spacing: 0; }
.spy-privacy { margin: 0 0 10px; padding: 8px 10px; border-left: 2px solid var(--amber); font-size: 12px; line-height: 1.6; color: #cfc6b1; background: rgba(245,179,66,.06); }

/* 冲印室 */
.crop { width: min(100%, 440px); height: 100%; display: flex; flex-direction: column; gap: 8px; }
.crop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; }
.crop-privacy { font: 11px var(--mono); color: #86efac; }
.crop-stage {
  position: relative;
  flex: 1;
  min-height: 140px;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(90% 80% at 50% 35%, #3a2a4f, #140e20);
  border: 1px solid rgba(245,179,66,.25);
  touch-action: none;
}
.crop-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crop-tip { position: absolute; left: 0; right: 0; bottom: 6px; margin: 0; text-align: center; font: 11px var(--mono); color: rgba(255,255,255,.55); pointer-events: none; }
.vessel-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vessel {
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 4px 10px;
  border-radius: 10px;
  color: #d8d0bd;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  font-size: 15px; font-weight: 700; letter-spacing: .1em;
}
.vessel canvas { width: 62px; height: 46px; flex: none; }
.vessel.is-active { color: #fff4d6; border-color: var(--amber); background: rgba(245,179,66,.12); }
.zoom-row { display: flex; align-items: center; gap: 12px; font: 12px var(--mono); color: #b9b09b; }
.zoom-row .slider { flex: 1; }
.spy-slider { --mc: #f5b342; }
.spy-slider .slider-fill { opacity: 1; }
.burn-toggle {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 6px 12px;
  border-radius: 10px;
  text-align: left;
  background: rgba(220,38,38,.06);
  border: 1px solid rgba(220,38,38,.25);
}
.burn-toggle .sw { position: relative; flex: none; width: 46px; height: 28px; border-radius: 14px; background: rgba(255,255,255,.15); transition: background .25s; }
.burn-toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease-spring); }
.burn-toggle[aria-checked="true"] .sw { background: var(--red); }
.burn-toggle[aria-checked="true"] .sw::after { transform: translateX(18px); }
.burn-toggle .bt { display: flex; flex-direction: column; gap: 2px; }
.burn-toggle b { font-size: 15px; color: #fecaca; letter-spacing: .12em; }
.burn-toggle small { font-size: 12px; color: #c9bfab; line-height: 1.4; }
.burn-toggle:disabled { opacity: .85; }

/* 自毁 */
.burn { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(100%, 360px); }
.burn-kicker { margin: 0; font: 12px var(--mono); letter-spacing: .18em; color: #fca5a5; }
.burn-card {
  position: relative;
  width: min(72vw, 260px);
  aspect-ratio: 13 / 15;
  border-radius: 4px;
  transition: box-shadow .4s;
  animation: cardTremble .12s infinite;
  animation-play-state: paused;
}
.burn-card.is-tense { animation-play-state: running; }
.burn-card.is-burning { box-shadow: 0 0 60px rgba(249,115,22,.55); animation: none; }
.burn-card canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.burn-card .stamp { top: auto; bottom: 18px; right: 12px; mix-blend-mode: multiply; opacity: .85; }
@keyframes cardTremble { 50% { transform: translate(1px, -1px) rotate(.3deg); } }
.burn-count { font: 800 64px/1 var(--mono); color: var(--red); text-shadow: 0 0 22px rgba(220,38,38,.7); }
.burn-count.tick { animation: countTick .5s ease; }
@keyframes countTick { 0% { transform: scale(1.4); } 100% { transform: none; } }
.burn-line { margin: 0; min-height: 1.6em; font: 15px var(--mono); letter-spacing: .08em; color: #f3e9cf; text-align: center; }

@media (max-height: 700px) {
  .dossier { padding: 22px 14px 12px; }
  .spy-title { font-size: 21px; margin-bottom: 6px; }
  .spy-list { gap: 4px; margin-bottom: 8px; }
  .spy-list li { font-size: 12.5px; }
  .spy-btn { min-height: 44px; }
  .key { height: 50px; }
  .typer { font-size: 14px; }
  .vessel { min-height: 50px; }
  .vessel canvas { width: 54px; height: 40px; }
}

/* ---------- 甜品合合 ---------- */
.card-merge { --c1: #fbbf24; }
.card:nth-child(5) { animation-delay: .28s; }
.view-merge {
  background:
    radial-gradient(90% 55% at 50% 0%, rgba(251, 146, 60, .22), transparent 70%),
    radial-gradient(60% 40% at 15% 85%, rgba(244, 114, 182, .12), transparent 70%),
    linear-gradient(180deg, #24140f 0%, #170d10 60%, #100a0d 100%);
}
.merge-score {
  justify-self: end;
  min-width: 88px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.merge-score b { font-size: 22px; font-weight: 800; color: #fde68a; letter-spacing: .02em; }
.merge-score span { font-size: 11.5px; color: var(--text-3); }
.merge-score i { font-style: normal; color: var(--text-2); }
.merge-hud {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 calc(var(--sar) + 14px) 0 calc(var(--sal) + 14px);
}
#merge-strip { flex: 1; min-width: 0; height: 34px; }
.merge-next {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 0 6px 0 10px;
  border-radius: 14px;
  background: rgba(255, 237, 213, .07);
  border: 1px solid rgba(255, 237, 213, .12);
  font-size: 12px;
  color: var(--text-2);
}
#merge-next { width: 40px; height: 40px; }
.merge-stage { position: relative; flex: 1; min-height: 0; touch-action: none; }
.merge-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.merge-hint {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--text-2);
  background: rgba(255, 237, 213, .07);
  border: 1px solid rgba(255, 237, 213, .12);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .6s, transform .6s var(--ease-out);
}
.merge-bar { min-height: 60px; }
.merge-bar .stat { white-space: normal; font-size: 12.5px; }
.merge-over, .merge-share {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--sat) + 20px) calc(var(--sar) + 20px) calc(var(--sab) + 20px) calc(var(--sal) + 20px);
  background: rgba(16, 8, 10, .62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility 0s linear .3s;
}
.merge-over.is-open, .merge-share.is-open { opacity: 1; visibility: visible; transition: opacity .3s; }
.merge-over-card, .merge-share-card {
  width: min(100%, 340px);
  padding: 22px 20px 18px;
  border-radius: 26px;
  text-align: center;
  background: linear-gradient(170deg, rgba(120, 53, 15, .55), rgba(30, 16, 18, .96));
  border: 1px solid rgba(253, 230, 138, .22);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8);
  transform: translateY(14px) scale(.96);
  transition: transform .45s var(--ease-spring);
}
.merge-over.is-open .merge-over-card, .merge-share.is-open .merge-share-card { transform: none; }
.merge-over-kicker { margin: 0; font-size: 12px; letter-spacing: .3em; color: #fdba74; }
.merge-over-card h3 { margin: 6px 0 4px; font-size: 22px; letter-spacing: .14em; }
.merge-over-score { font-size: 56px; font-weight: 900; line-height: 1.1; color: #fde68a; font-variant-numeric: tabular-nums; text-shadow: 0 4px 24px rgba(251, 191, 36, .45); }
.merge-over-new {
  display: inline-block;
  margin: 2px 0 4px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  color: #431407;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  animation: bump .6s var(--ease-spring) .2s both;
}
.merge-over-best, .merge-over-top { margin: 4px 0 0; font-size: 14px; color: var(--text-2); }
.merge-over-btns { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; margin-top: 16px; }
.merge-dl { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.merge-share-card img {
  display: block;
  width: 100%;
  max-height: 52vh;
  object-fit: contain;
  border-radius: 14px;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}
.merge-share-card p { margin: 10px 0 0; font-size: 13px; color: var(--text-2); }

@media (max-height: 700px) {
  .card { min-height: 62px; }
  .card-art { width: 54px; }
  .cards { gap: 9px; }
  .merge-hud { height: 46px; }
  #merge-next { width: 36px; height: 36px; }
}

/* ---------- breathe ---------- */
.view-breathe { background: linear-gradient(180deg, #0b1230 0%, #18194a 45%, #2b1d4f 75%, #3a2350 100%); }
.breathe-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.breathe-bg::before {
  content: "";
  position: absolute;
  left: -20%; right: -20%; bottom: -30%;
  height: 70%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(251, 146, 60, .16), transparent 70%);
  animation: glowDrift 22s ease-in-out infinite alternate;
}
.stars { position: absolute; inset: 0; }
.star {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: #fff;
  opacity: .5;
  animation: twinkle var(--d, 4s) ease-in-out infinite;
  animation-delay: var(--dl, 0s);
}
@keyframes twinkle { 0%, 100% { opacity: .12; } 50% { opacity: .8; } }
.view-breathe > :not(.breathe-bg):not(.sheet) { position: relative; z-index: 1; }
.chips {
  flex: none;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 4px calc(var(--sar) + 12px) 0 calc(var(--sal) + 12px);
}
.chip {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  transition: all .3s var(--ease-out);
  white-space: nowrap;
}
.chip small { display: block; font-size: 11px; color: var(--text-3); margin-top: -2px; }
.chip.is-active { color: #0b1022; background: linear-gradient(180deg, #e0e7ff, #a5b4fc); border-color: transparent; }
.chip.is-active small { color: rgba(11, 16, 34, .6); }
.chip:active { transform: scale(.95); }
.breathe-stage { flex: 1; min-height: 0; position: relative; }
.breathe-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.breathe-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-shadow: 0 2px 18px rgba(30, 27, 75, .7);
}
.breathe-phase { font-size: clamp(28px, 8vw, 36px); font-weight: 600; letter-spacing: .4em; padding-left: .4em; transition: opacity .4s; }
.breathe-count { margin-top: 6px; font-size: 18px; color: var(--text-2); font-variant-numeric: tabular-nums; letter-spacing: .1em; min-height: 1.4em; }
.breathe-phase.fade { opacity: 0; }
.breathe-controls {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px calc(var(--sar) + 18px) calc(var(--sab) + 16px) calc(var(--sal) + 18px);
}
.breathe-controls > :last-child { justify-self: end; }

.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  padding: 0 calc(var(--sar) + 16px) calc(var(--sab) + 14px) calc(var(--sal) + 16px);
  border-radius: 28px 28px 0 0;
  background: rgba(20, 20, 52, .82);
  border-top: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
  box-shadow: 0 -20px 50px -10px rgba(0, 0, 0, .55);
  transform: translate3d(0, 105%, 0);
  transition: transform .45s var(--ease-out);
  touch-action: none;
}
.sheet.is-open { transform: none; }
.sheet-grip { display: flex; justify-content: center; padding: 10px 0 4px; }
.sheet-grip span { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 6px; }
.sheet-head h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: .1em; }
.mixer { display: flex; flex-direction: column; gap: 6px; }
.mix-row {
  display: grid;
  grid-template-columns: 52px 64px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 52px;
}
.mix-btn {
  width: 48px; height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  transition: transform .25s var(--ease-spring), background .3s, box-shadow .3s;
}
.mix-btn svg { width: 26px; height: 26px; opacity: .6; transition: opacity .3s; }
.mix-row.is-on .mix-btn { background: linear-gradient(160deg, var(--mc), rgba(255,255,255,.05)); box-shadow: 0 6px 20px -6px var(--mc); }
.mix-row.is-on .mix-btn svg { opacity: 1; }
.mix-btn:active { transform: scale(.9); }
.mix-name { font-size: 15px; color: var(--text-2); transition: color .3s; }
.mix-row.is-on .mix-name { color: var(--text); }
.slider {
  position: relative;
  height: 44px;
  touch-action: none;
  cursor: pointer;
}
.slider-track {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 8px;
  margin-top: -4px;
  border-radius: 4px;
  background: rgba(255,255,255,.1);
  overflow: hidden;
}
.slider-fill {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: scaleX(var(--v, .5));
  background: linear-gradient(90deg, rgba(255,255,255,.25), var(--mc));
  border-radius: 4px;
  opacity: .45;
  transition: opacity .3s;
}
.mix-row.is-on .slider-fill { opacity: 1; }
.slider-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 24px; height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  transform: translate3d(var(--kx, 0px), 0, 0);
  transition: transform .05s linear, scale .2s;
}
.slider.is-dragging .slider-knob { scale: 1.15; }

/* ---------- intro ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: calc(var(--sat) + 24px) 24px calc(var(--sab) + 24px);
  background: rgba(5, 7, 18, .72);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  animation: fadeIn .4s ease;
  transition: opacity .4s ease;
}
.intro[hidden] { display: none; }
.intro.is-leaving { opacity: 0; }
@keyframes fadeIn { from { opacity: 0; } }
.intro-card {
  width: min(100%, 360px);
  padding: 30px 24px 24px;
  border-radius: 30px;
  text-align: center;
  background: linear-gradient(170deg, rgba(49, 46, 129, .55), rgba(15, 18, 40, .9));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8);
  animation: cardIn .6s var(--ease-out);
}
.intro-orb {
  width: 96px; height: 96px; margin: 0 auto 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #c4b5fd 25%, #6366f1 70%, #312e81);
  box-shadow: 0 0 60px rgba(129, 140, 248, .7);
  animation: breathMini 5s ease-in-out infinite;
}
.intro-card h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: .06em; }
.intro-card p { margin: 0 0 22px; font-size: 14px; line-height: 1.7; color: var(--text-2); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--sat) + var(--topbar-h) + 10px);
  z-index: 90;
  transform: translate(-50%, -12px);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: .06em;
  background: rgba(30, 32, 70, .9);
  border: 1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .4s var(--ease-spring);
  white-space: nowrap;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* small screens (iPhone SE) */
@media (max-height: 700px) {
  :root { --topbar-h: 50px; }
  .card { gap: 12px; padding: 10px 14px 10px 10px; }
  .card-title { font-size: 17px; }
  .card-desc { font-size: 12.5px; }
  .home-header { padding-top: 2px; }
  .brand-mark { width: 44px; height: 44px; }
  .primary-btn { min-height: 50px; }
  .mix-row { min-height: 46px; }
}

@media (min-width: 700px) {
  .view-home { max-width: 560px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .home-glow, .breathe-bg::before, .brand-mark { animation: none; }
}
