/* ==========================================================================
   捏捏 · shared
   ========================================================================== */

:root {
  --bg: #f8f3ec;
  --surface: #fffdfa;
  --ink: #241d1a;
  --ink-2: #5b4f48;
  --muted: #93857a;
  --faint: #b3a79c;
  --line: rgba(36, 29, 26, 0.09);
  --line-strong: rgba(36, 29, 26, 0.16);
  --accent: #cf3a4c;
  --accent-2: #e0606c;
  --accent-soft: rgba(207, 58, 76, 0.1);
  --gold: #c69a45;
  --shadow-card: 0 24px 50px -34px rgba(90, 55, 35, 0.5), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-serif: Georgia, "Songti SC", "SimSun", "Noto Serif CJK SC", "Times New Roman", serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* background wash ---------------------------------------------------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 50% -12%, #fffdf7 0%, rgba(255, 253, 247, 0) 68%),
    linear-gradient(180deg, #faf5ee 0%, #f5eee4 58%, #f0e7dc 100%);
}

.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 92% at 50% 40%, rgba(255, 255, 255, 0) 38%, rgba(122, 82, 56, 0.07) 100%);
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.22'/></svg>");
  mix-blend-mode: multiply;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

.blob-1 {
  width: 46vw;
  height: 46vw;
  left: -14vw;
  bottom: -18vw;
  background: radial-gradient(circle, rgba(230, 120, 110, 0.34), rgba(230, 120, 110, 0) 70%);
}

.blob-2 {
  width: 40vw;
  height: 40vw;
  right: -10vw;
  top: -12vw;
  background: radial-gradient(circle, rgba(214, 168, 92, 0.3), rgba(214, 168, 92, 0) 70%);
}

.blob-3 {
  width: 34vw;
  height: 34vw;
  right: 16vw;
  bottom: -20vw;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 70%);
  opacity: 0.8;
}

/* top bar ------------------------------------------------------------------ */
.topbar {
  position: relative;
  z-index: 6;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(18px, 4vw, 46px) 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-name {
  white-space: nowrap;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.brand-sub {
  font-size: 8.5px;
  letter-spacing: 0.26em;
  color: var(--faint);
  padding-left: 2px;
}

.nav { display: flex; align-items: center; gap: 10px; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink-2);
  font-size: 12.5px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.22s, color 0.22s, transform 0.22s, box-shadow 0.22s;
}

.nav-btn svg { width: 15px; height: 15px; opacity: 0.8; }

.nav-btn:hover {
  background: #fff;
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px -18px rgba(90, 55, 35, 0.8);
}

.nav-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.nav-btn.is-back svg { transform: rotate(180deg); }

.fox-link { color: var(--accent); }
.fox-link:hover { color: var(--accent); }

.sound-toggle {
  font-family: inherit;
  cursor: pointer;
}

.sound-toggle .ico-off { display: none; }
.sound-toggle[aria-pressed="false"] .ico-on { display: none; }
.sound-toggle[aria-pressed="false"] .ico-off { display: inline-block; }
.sound-toggle[aria-pressed="false"] {
  color: var(--faint);
  background: rgba(255, 255, 255, 0.34);
}

.sound-toggle[aria-pressed="false"] svg { opacity: 0.55; }

/* stage -------------------------------------------------------------------- */
.stage-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 10px;
  outline: none;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transform: translateY(14px);
}

.stage:focus-visible {
  outline: 2px solid rgba(207, 58, 76, 0.35);
  outline-offset: 6px;
  border-radius: 36px;
}

.stage.is-pressed { cursor: grabbing; }

.halo {
  position: absolute;
  width: min(86vw, 78vh, 860px);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 46%,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 251, 245, 0.62) 42%,
    rgba(255, 255, 255, 0) 68%
  );
  transition: transform 0.5s var(--ease-out), opacity 0.4s ease;
}

.stage.is-pressed .halo { transform: scale(0.972); opacity: 0.92; }

.halo::before,
.halo::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(36, 29, 26, 0.055);
}

.halo::before { inset: 8%; }
.halo::after { inset: 21%; opacity: 0.7; }

.figure {
  position: relative;
  z-index: 1;
  --fig-w: min(90vw, 70vh, 800px);
  width: var(--fig-w);
  aspect-ratio: 921 / 760;
}

.float {
  position: absolute;
  inset: 0;
  animation: floaty 6.5s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.character {
  position: absolute;
  inset: 0;
  z-index: 1;
  filter: drop-shadow(0 20px 22px rgba(96, 58, 38, 0.2));
  transform: scale(1) translateY(0);
  transition:
    transform 0.44s var(--ease-out),
    filter 0.3s ease;
  will-change: transform;
}

.stage.is-pressed .character {
  transform: scale(0.934) translateY(11px);
  filter: drop-shadow(0 8px 10px rgba(96, 58, 38, 0.22)) brightness(0.985);
  transition:
    transform 0.1s cubic-bezier(0.25, 0.7, 0.4, 1),
    filter 0.1s ease;
}

/* 复活时的小弹跳 */
.character.is-reviving {
  animation: revivePop 0.6s cubic-bezier(0.22, 1.2, 0.36, 1);
}

@keyframes revivePop {
  0% { transform: scale(0.9) translateY(16px); }
  42% { transform: scale(1.045) translateY(-7px); }
  68% { transform: scale(0.99) translateY(3px); }
  100% { transform: scale(1) translateY(0); }
}

/* 复活时的一圈白光 */
.revive-flash {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 64%;
  aspect-ratio: 1;
  margin: -32% 0 0 -32%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 252, 244, 0.55) 42%, rgba(255, 255, 255, 0) 68%);
  animation: reviveFlash 0.62s ease-out forwards;
}

@keyframes reviveFlash {
  0% { opacity: 0; transform: scale(0.35); }
  22% { opacity: 0.95; }
  100% { opacity: 0; transform: scale(1.45); }
}

/* 长按后开始发抖：用独立的 translate 属性，和上面的 scale 叠加 */
.character.hold-long {
  animation: tremble 0.16s linear infinite;
}

@keyframes tremble {
  0%, 100% { translate: 0 0; }
  20% { translate: -1.8px 0.6px; }
  40% { translate: 1.6px -0.7px; }
  60% { translate: -1.2px -0.5px; }
  80% { translate: 1.4px 0.8px; }
}

.art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: opacity 0.05s linear;
}

.art-press { opacity: 0; }

.stage.is-pressed .art-press { opacity: 1; }
.stage.is-pressed .art-idle { opacity: 0; }

/* 倒地事件：三张图叠在一起，倒地时只显示倒地图 */
.art-defeat { opacity: 0; }

.stage.is-defeat .art-idle,
.stage.is-defeat .art-press { opacity: 0; }

.stage.is-defeat .art-defeat { opacity: 1; }

.stage.is-defeat .ground { width: 78%; opacity: 0.7; }

.ground {
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: -1%;
  width: 60%;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(96, 58, 38, 0.28), rgba(96, 58, 38, 0) 72%);
  filter: blur(3px);
  transition: width 0.4s var(--ease-out), opacity 0.4s ease;
}

.stage.is-pressed .ground { width: 68%; opacity: 0.8; }

/* 按住时头顶的对白气泡 */
.say {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 4;
  width: max-content;
  max-width: min(74vw, 390px);
  padding: 12px 20px;
  border-radius: 18px;
  background: #fffdfa;
  border: 1px solid rgba(36, 29, 26, 0.08);
  box-shadow: 0 22px 44px -30px rgba(70, 40, 25, 0.75), 0 1px 0 #fff inset;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 12px) scale(0.94);
  transform-origin: 50% 100%;
  transition:
    opacity 0.13s ease,
    transform 0.13s ease,
    visibility 0s linear 0.13s;
}

.stage.is-pressed .say:not(.is-defeat) {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
  transition:
    opacity 0.16s ease-out,
    transform 0.24s cubic-bezier(0.2, 1.5, 0.4, 1),
    visibility 0s;
}

.say-pic { display: none; }

.say-pic img {
  display: block;
  width: clamp(112px, calc(var(--fig-w, 630px) * 0.32), 208px);
  height: auto;
  border-radius: 13px;
}

.say.is-pic {
  padding: 7px;
  border-radius: 20px;
}

.say.is-pic .say-text { display: none; }

.say.is-pic .say-pic { display: block; }

.say-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.72;
  letter-spacing: 0.02em;
  color: #3b312c;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
}

.say-tail {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: #fffdfa;
  border-right: 1px solid rgba(36, 29, 26, 0.08);
  border-bottom: 1px solid rgba(36, 29, 26, 0.08);
  border-bottom-right-radius: 3px;
  transform: rotate(45deg);
}

.say.is-defeat {
  left: auto;
  right: 1%;
  top: 6%;
  bottom: auto;
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  animation: defeatSay 0.34s var(--ease-out) both;
}

.say.is-defeat .say-tail { left: 24%; }

@keyframes defeatSay {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 按下时在人物周围蹦出来的「哈！」 */
.ha {
  position: absolute;
  z-index: 3;
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: haPop 1s cubic-bezier(0.2, 0.85, 0.3, 1) forwards;
  text-shadow:
    3px 0 0 #fffdfa, -3px 0 0 #fffdfa, 0 3px 0 #fffdfa, 0 -3px 0 #fffdfa,
    2px 2px 0 #fffdfa, -2px 2px 0 #fffdfa, 2px -2px 0 #fffdfa, -2px -2px 0 #fffdfa,
    0 14px 26px rgba(120, 40, 40, 0.16);
}

@keyframes haPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45) rotate(var(--rot, -8deg));
  }
  14% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08) rotate(var(--rot, -8deg));
  }
  26% {
    transform: translate(-50%, -50%) scale(1) rotate(var(--rot, -8deg));
  }
  68% {
    opacity: 1;
    transform: translate(-50%, -56%) scale(1) rotate(var(--rot, -8deg));
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -74%) scale(0.98) rotate(var(--rot, -8deg));
  }
}

/* effects ------------------------------------------------------------------ */
.fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.fx-front { z-index: 3; }

.puff {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: rgba(146, 104, 76, 0.18);
  filter: blur(1.5px);
  opacity: 0;
  animation: puffOut 0.8s ease-out forwards;
}

@keyframes puffOut {
  0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  22% { opacity: 0.75; }
  100% { opacity: 0; transform: translate(var(--dx, 20px), var(--dy, -26px)) scale(1.5); }
}

/* dock --------------------------------------------------------------------- */
.dock {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
}

.dock-action {
  display: grid;
  place-items: center;
  min-height: 36px;
}

.dock-action > * { grid-area: 1 / 1; }

.hint[hidden] { display: none; }

.revive {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 14px 28px -16px rgba(207, 58, 76, 0.95);
  animation: reviveIn 0.28s var(--ease-out);
  transition: filter 0.2s, transform 0.2s;
}

.revive svg { width: 14px; height: 14px; }

.revive:hover { filter: brightness(1.06); transform: translateY(-1px); }

.revive[hidden] { display: none; }

@keyframes reviveIn {
  from { opacity: 0; transform: translateY(8px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hint {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.hint-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(207, 58, 76, 0.1);
  animation: dotPulse 2.4s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(207, 58, 76, 0.08); }
  50% { box-shadow: 0 0 0 5px rgba(207, 58, 76, 0.14); }
}

.hint-play {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.hint-play svg { width: 14px; height: 14px; }

.hint-play:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent);
  transform: scale(1.06);
}

.counter {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 15px 13px 24px;
  border-radius: 24px;
  border: 1px solid rgba(36, 29, 26, 0.08);
  background: rgba(255, 253, 249, 0.74);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: var(--shadow-card);
}

.counter-side {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 92px;
}

.counter-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.counter-sub {
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.02em;
}

.counter-main {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding-right: 18px;
  border-right: 1px solid var(--line);
}

.counter-num {
  font-family: var(--font-serif);
  font-size: 47px;
  line-height: 1;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  min-width: 1.1ch;
  display: inline-block;
  transform-origin: 50% 65%;
}

.counter-num.bump { animation: bump 0.34s cubic-bezier(0.3, 1.4, 0.4, 1); }

@keyframes bump {
  0% { transform: scale(1); }
  32% { transform: scale(1.11); color: var(--accent); }
  100% { transform: scale(1); }
}

.counter-unit {
  font-size: 11.5px;
  color: var(--muted);
}

.reset {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.reset:hover {
  background: #fff;
  color: var(--accent);
  border-color: rgba(207, 58, 76, 0.28);
}

.reset.armed {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ==========================================================================
   voices page
   ========================================================================== */

.page-voices { display: block; min-height: 100svh; }

.page-voices .topbar {
  width: min(900px, 100%);
  margin: 0 auto;
  padding-left: clamp(18px, 4vw, 30px);
  padding-right: clamp(18px, 4vw, 30px);
}

.voice-wrap {
  position: relative;
  z-index: 2;
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 6px clamp(18px, 4vw, 30px) 72px;
}

.page-head { margin: 4px 0 26px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 9.5px;
  letter-spacing: 0.34em;
  color: var(--gold);
  text-transform: uppercase;
}

.page-head h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(32px, 4.4vw, 46px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.lede {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 46em;
}

.lede code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(36, 29, 26, 0.05);
  color: var(--ink-2);
}

.player-panel {
  max-width: 840px;
  margin: 0 auto;
  min-height: 240px;
  display: flex;
  flex-direction: column;
}

.panel {
  border: 1px solid rgba(36, 29, 26, 0.07);
  border-radius: 22px;
  background: rgba(255, 253, 250, 0.72);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: var(--shadow-card);
  padding: 18px;
}

.player-panel .sound-list {
  flex: 1 1 auto;
  max-height: none;
  overflow: visible;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--ink-2);
}

.stat {
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.stat b { color: var(--ink); font-weight: 600; }

.sound-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: min(56vh, 540px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(36, 29, 26, 0.16) transparent;
}

.sound-list::-webkit-scrollbar { width: 6px; }
.sound-list::-webkit-scrollbar-thumb {
  background: rgba(36, 29, 26, 0.14);
  border-radius: 3px;
}

.sound {
  display: grid;
  grid-template-columns: 38px 26px minmax(0, 1fr) 88px 46px;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border-radius: 14px;
  border-bottom: 1px solid rgba(36, 29, 26, 0.045);
  transition: background 0.18s ease;
}

.sound:hover { background: rgba(255, 255, 255, 0.85); }

.sound.is-playing { background: rgba(207, 58, 76, 0.055); }

.sound:last-child { border-bottom: none; }

.sound-index {
  font-family: var(--font-serif);
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.sound-time {
  font-size: 10.5px;
  color: var(--faint);
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.play {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}

.play svg { width: 12px; height: 12px; margin-left: 1px; }

.play:hover { border-color: rgba(207, 58, 76, 0.4); color: var(--accent); }

.sound.is-playing .play {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sound.is-playing .play svg { margin-left: 0; }

.meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sound-tag {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  line-height: 1.4;
  letter-spacing: 0.08em;
}

.sound-name {
  font-size: 13.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.wave {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  height: 22px;
  width: 88px;
  opacity: 0.9;
}

.wave i {
  display: block;
  flex: 0 0 2px;
  width: 2px;
  min-height: 2px;
  border-radius: 1px;
  background: #ded2c6;
  transition: background 0.2s ease, transform 0.2s ease;
}

.sound.is-playing .wave i { background: var(--accent); }

.empty {
  flex: 1 1 auto;
  display: grid;
  place-content: center;
  gap: 2px;
  padding: 32px 16px;
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.9;
}

.empty[hidden] { display: none; }

.empty strong { display: block; color: var(--ink-2); font-weight: 500; }

/* toast -------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(36, 29, 26, 0.9);
  color: #fff;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}

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

/* responsive --------------------------------------------------------------- */
@media (max-width: 960px) {
  .player-panel { min-height: 260px; }
}

@media (max-width: 720px) {
  .brand-sub { display: none; }
  .nav { gap: 6px; }
  .nav-btn { padding: 8px 10px; font-size: 11.5px; }
  .topbar { padding-top: 16px; }
  .stage-wrap { padding: 0 10px; }
  .figure { --fig-w: min(94vw, 56vh, 560px); }
  .dock { gap: 10px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .counter { gap: 14px; padding: 10px 11px 10px 16px; border-radius: 18px; }
  .counter-num { font-size: 34px; }
  .counter-side { min-width: 76px; }
  .counter-sub { display: none; }
  .counter-main { padding-right: 13px; }
  .hint { font-size: 10.5px; letter-spacing: 0.1em; }
  .reset { padding: 7px 10px; font-size: 10px; }
  .sound { grid-template-columns: 32px 22px minmax(0, 1fr) 42px; gap: 8px; padding: 10px 6px; }
  .wave { display: none; }
  .play { width: 32px; height: 32px; }
}

@media (max-height: 800px) {
  .figure { --fig-w: min(90vw, 63vh, 800px); }
  .stage { transform: translateY(6px); }
}

@media (max-height: 620px) {
  .figure { --fig-w: min(80vh, 86vw); }
  .stage { transform: none; }
  .dock { gap: 8px; padding-top: 4px; }
  .hint { display: none; }
  .say { font-size: 13px; }
}

@media (max-height: 520px) {
  .figure { --fig-w: min(60vh, 72vw); }
  .topbar { padding-top: 10px; padding-bottom: 4px; }
  .stage { padding: 4px; }
  .dock { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .counter { padding: 8px 10px 8px 16px; border-radius: 18px; }
  .counter-num { font-size: 32px; }
  .say { font-size: 12.5px; padding: 9px 14px; bottom: calc(100% + 8px); }
}

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

@media (max-width: 430px) {
  #soundToggleText { display: none; }
  .sound-toggle { padding: 8px 9px; }
}

@media (max-width: 380px) {
  .brand-name { font-size: 17px; }
  .nav-btn { padding: 7px 9px; font-size: 11px; }
  .nav-label { display: none; }
}
