.topbar-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sound-toggle {
  display: inline-flex;
  min-width: 42px;
  min-height: 42px;
  padding: 0 13px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(22, 32, 51, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  box-shadow: 0 6px 20px rgba(31, 42, 68, 0.04);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 120ms ease;
}

.sound-toggle:hover {
  border-color: rgba(87, 92, 231, 0.18);
  background: rgba(255, 255, 255, 0.92);
}

.sound-toggle:active {
  transform: scale(0.96);
}

.sound-toggle[aria-pressed="true"] {
  border-color: rgba(87, 92, 231, 0.16);
  background: rgba(238, 240, 255, 0.82);
  color: var(--accent);
}

.sound-wave {
  display: flex;
  width: 16px;
  height: 15px;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}

.sound-wave i {
  width: 3px;
  height: 12px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center bottom;
  animation: sound-wave 1.05s ease-in-out infinite;
}

.sound-wave i:nth-child(1) {
  height: 7px;
  animation-delay: -0.3s;
}

.sound-wave i:nth-child(2) {
  height: 13px;
  animation-delay: -0.62s;
}

.sound-wave i:nth-child(3) {
  height: 9px;
  animation-delay: -0.12s;
}

.sound-toggle[aria-pressed="false"] {
  color: var(--muted-light);
}

.sound-toggle[aria-pressed="false"] .sound-wave i {
  height: 3px;
  opacity: 0.55;
  animation-play-state: paused;
}

.sound-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.touch-impact {
  --impact-color: var(--accent);
  position: absolute;
  top: var(--impact-y);
  left: var(--impact-x);
  z-index: 8;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 1.5px solid var(--impact-color);
  border-radius: 50%;
  background: color-mix(in srgb, var(--impact-color) 18%, transparent);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.68),
    0 0 18px color-mix(in srgb, var(--impact-color) 34%, transparent);
  opacity: 0;
  pointer-events: none;
  animation: touch-impact 440ms cubic-bezier(0.16, 0.72, 0.24, 1) forwards;
}

.touch-impact--correct {
  --impact-color: var(--teal);
}

.touch-impact--wrong {
  --impact-color: var(--danger, var(--red, #d95750));
}

.touch-impact--start,
.touch-impact--complete,
.touch-impact--toggleOn {
  --impact-color: var(--accent);
}

@keyframes sound-wave {
  0%, 100% { transform: scaleY(0.42); }
  50% { transform: scaleY(1); }
}

@keyframes touch-impact {
  0% { transform: scale(0.35); opacity: 0.82; }
  72% { opacity: 0.22; }
  100% { transform: scale(5.6); opacity: 0; }
}

@media (max-width: 680px) {
  .topbar-tools {
    gap: 7px;
  }

  .sound-toggle {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
  }

  .sound-label {
    display: none;
  }
}
