/* Sound toggle of the 3D board (assets/world/audio.js). Every visible rule is
   scoped to html.mode-3d; the classic page and print never show it. */

.snd-toggle { display: none; }
.world-hud .wh-key-sound { display: none; }
.snd-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media screen {
  html.mode-3d .world-hud .wh-key-sound:not([hidden]) { display: inline; }

  /* Above the corner mini map (bottom right; 16 px + its 174 px + a 10 px gap), clear
     of the key hints, the prompts and the race HUD */
  html.mode-3d .snd-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    z-index: 33;
    right: 16px;
    bottom: 200px;
    height: 36px;
    padding: 0 14px 0 11px;
    font: 500 13px/1 "IBM Plex Mono", ui-monospace, Consolas, monospace;
    letter-spacing: .04em;
    color: #c6d0c8;
    background: rgba(6, 19, 14, .82);
    border: 1px solid rgba(244, 242, 233, .22);
    border-radius: 999px;
    cursor: pointer;
    transition: border-color .18s, background-color .18s, color .18s;
  }
  html.mode-3d .snd-toggle[hidden] { display: none; }
  html.mode-3d .snd-toggle:hover { color: #f4f2e9; border-color: rgba(224, 169, 74, .7); }
  html.mode-3d .snd-toggle.is-on { color: #f4f2e9; background: #0f271e; border-color: rgba(224, 169, 74, .6); }
  html.mode-3d .snd-toggle.is-on:hover { background: #16362a; border-color: #e0a94a; }
  html.mode-3d .snd-toggle:focus-visible { outline: 2px solid #ffd482; outline-offset: 2px; }
  html.mode-3d .snd-ico {
    width: 17px;
    height: 17px;
    flex: none;
    fill: none;
    stroke: #93a69b;
    stroke-width: 1.5;
    stroke-linejoin: round;
    stroke-linecap: round;
  }
  html.mode-3d .snd-toggle.is-on .snd-ico { stroke: #e0a94a; }
  html.mode-3d .snd-toggle .snd-ico-on,
  html.mode-3d .snd-toggle.is-on .snd-ico-off { display: none; }
  html.mode-3d .snd-toggle.is-on .snd-ico-on { display: inline; }

  /* a card or the board map takes the corner (the mini map steps aside too) */
  html.mode-3d.card-open .snd-toggle,
  html.mode-3d.map-open .snd-toggle { display: none; }

  /* narrow windows: the small mini map (129 px with its caption) stays in the bottom right */
  @media (max-width: 759px) {
    html.mode-3d .snd-toggle { bottom: 155px; }
    /* touch phones: the map moves to the top right and the joystick owns the bottom
       left, so the toggle takes the bottom right as an icon button (the label stays
       its name) */
    html.mode-3d .snd-toggle.is-touch {
      bottom: 24px;
      width: 44px;
      height: 44px;
      padding: 0;
      justify-content: center;
    }
    html.mode-3d .snd-toggle.is-touch .snd-ico { width: 20px; height: 20px; }
    html.mode-3d .snd-toggle.is-touch .snd-label {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html.mode-3d .snd-toggle { transition: none; }
  }
}

@media print {
  .snd-toggle, .snd-live { display: none !important; }
}
