/* Screen feel from juice.js, and the speaker menu from audio.js. */
#app.shake1 { animation: jshake1 200ms steps(5, end); }
#app.shake2 { animation: jshake2 300ms steps(7, end); }
#app.shake3 { animation: jshake3 500ms steps(10, end); }
@keyframes jshake1 { 25% { transform: translate(-2px, 1px); } 50% { transform: translate(2px, -1px); } 75% { transform: translate(-1px, 0); } }
@keyframes jshake2 { 15% { transform: translate(-4px, 2px); } 35% { transform: translate(4px, -2px); } 55% { transform: translate(-3px, 1px); } 75% { transform: translate(2px, -1px); } 90% { transform: translate(-1px, 0); } }
@keyframes jshake3 { 10% { transform: translate(-8px, 3px) rotate(-1deg); } 22% { transform: translate(8px, -4px) rotate(1deg); } 36% { transform: translate(-6px, 2px) rotate(-.7deg); }
  50% { transform: translate(5px, -2px) rotate(.5deg); } 66% { transform: translate(-3px, 1px) rotate(-.3deg); } 82% { transform: translate(2px, 0); } }
#app.hitstop, #app.hitstop * { animation-play-state: paused !important; }

.jflash { position: absolute; inset: 0; z-index: 25; pointer-events: none; animation: jflash 260ms ease-out forwards; }
.jflash.white { background: #fff; }
.jflash.gold { background: radial-gradient(circle at 50% 45%, rgba(255,230,150,.95), rgba(255,200,90,.35) 60%, transparent); }
.jflash.red { background: radial-gradient(circle, transparent 40%, rgba(216,67,79,.55)); }
@keyframes jflash { from { opacity: .85; } to { opacity: 0; } }

.chainpop { position: absolute; z-index: 18; pointer-events: none; transform: translate(-50%, -100%); white-space: nowrap;
  font-family: var(--pixel, inherit); color: var(--cream, #f4ead2); text-shadow: var(--ink-outline, 0 2px 0 #000); font-size: 18px;
  animation: chainpop 900ms cubic-bezier(.34, 1.56, .64, 1) forwards; }
.chainpop b { color: var(--gold, #f2c14e); font-weight: 400; }
.chainpop.s3 { font-size: 22px; }
.chainpop.s4 { font-size: 28px; }
.chainpop.s4 b { color: #fff3c4; text-shadow: var(--ink-outline, 0 2px 0 #000), 0 0 12px rgba(255,220,120,.9); }
@keyframes chainpop { 0% { transform: translate(-50%, -100%) scale(.3); opacity: 0; } 22% { transform: translate(-50%, -100%) scale(1.35); opacity: 1; }
  40% { transform: translate(-50%, -100%) scale(.95); } 55% { transform: translate(-50%, -100%) scale(1.05); } 75% { transform: translate(-50%, -110%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -150%) scale(1); opacity: 0; } }

/* Big hits: the number punches in larger and overshoots. */
.float.big { font-size: 30px; animation: jfloatbig 950ms cubic-bezier(.34, 1.56, .64, 1) forwards; }
@keyframes jfloatbig { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 20% { transform: translate(-50%, -60%) scale(1.5); opacity: 1; }
  40% { transform: translate(-50%, -65%) scale(1); } 100% { transform: translate(-50%, -140%) scale(1); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  #app.shake1, #app.shake2, #app.shake3, .chainpop, .float.big { animation: none !important; }
  .chainpop { opacity: 0; }
}

.audio-menu { position: fixed; z-index: 1000; display: flex; flex-direction: column; gap: 0; padding: 6px; width: 230px; max-width: calc(100vw - 16px); box-sizing: border-box;
  background: var(--ink-2, #1d2140); border: 2px solid var(--line, #3b4170); box-shadow: 0 4px 0 rgba(0,0,0,.45); font-family: var(--pixel, inherit); }
.audio-menu button { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; min-height: 40px;
  background: transparent; border: 0; color: var(--cream, #f4ead2); font: inherit; font-size: 14px; text-align: left; }
.audio-menu button i { font-style: normal; color: var(--cream-dim, #8f8aa8); }
.audio-menu button[aria-pressed="true"] i { color: var(--teal, #6fd6c4); }
.audio-menu button:active { background: rgba(255,255,255,.06); }
.audio-menu .am-vol + button { margin-top: 4px; border-top: 1px solid var(--line, #3b4170); }

/* Volume sliders (speaker menu and profile settings): the native range, 44px tall so a thumb is easy to catch. */
.am-vol { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; box-sizing: border-box; }
.am-vol input { flex: 1; min-width: 0; height: 44px; margin: 0; accent-color: var(--teal, #6fd6c4); cursor: pointer; touch-action: none; }
.am-vol output { min-width: 3.2em; text-align: right; font-size: 13px; color: var(--cream-dim, #8f8aa8); font-variant-numeric: tabular-nums; }
.pf-row.pf-vol { cursor: default; padding: 0 4px 0 12px; }
.pf-row.pf-vol .am-vol { flex: 1; padding: 0; }
