/* Wild Rift Boost — sound.css (sound toggle, load AFTER animations.css).
   THEME: same muted dark + single gold accent as style.css.
   PLACEMENT (deliberate): the toggle is IN-FLOW inside the header
   <nav> links, as the last item in the nav links — NOT
   position:fixed and NOT position:absolute. The header is sticky,
   so the toggle stays at the top of the site on scroll, while
   in-flow placement means it can never cover content, a CTA, or
   the log-in dialog (a fixed button at the top-right would sit
   over #authArea / the auth card on mobile). It is a plain button,
   not a .btn, so it takes none of the .btn sizing or colour.
   See sound-wiring.md for the exact HTML snippet. */

/* --- the button: 44px touch target, icon only --- */
#soundToggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  padding:0;
  margin:0;
  background:transparent;
  color:var(--muted);
  border:1px solid var(--line);
  border-radius:10px;
  cursor:pointer;
  line-height:0;
  vertical-align:middle;
  transition:color .2s ease, border-color .2s ease,
    background-color .2s ease, opacity .2s ease;
}
#soundToggle:hover{
  color:var(--text);
  border-color:rgba(217,179,106,.5);
}
/* --- OFF state (default): muted speaker + slash, dimmed --- */
#soundToggle[aria-pressed="false"],
#soundToggle.sound-off{
  opacity:.65;
}
#soundToggle[aria-pressed="false"] .snd-icon-on,
#soundToggle.sound-off .snd-icon-on{
  display:none;
}
#soundToggle[aria-pressed="false"] .snd-icon-off,
#soundToggle.sound-off .snd-icon-off{
  display:inline-flex;
}
/* --- ON state: gold speaker + waves, full opacity, gold tint --- */
#soundToggle[aria-pressed="true"],
#soundToggle.sound-on{
  opacity:1;
  color:var(--gold);
  border-color:rgba(217,179,106,.55);
  background:rgba(217,179,106,.10);
}
#soundToggle[aria-pressed="true"] .snd-icon-off,
#soundToggle.sound-on .snd-icon-off{
  display:none;
}
#soundToggle[aria-pressed="true"] .snd-icon-on,
#soundToggle.sound-on .snd-icon-on{
  display:inline-flex;
}
/* Icon spans: centre the inline SVG, no extra space. */
#soundToggle .snd-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:0;
}
#soundToggle .snd-icon svg{
  display:block;
  width:22px;
  height:22px;
}
/* --- keyboard focus: same gold ring as animations.css --- */
#soundToggle:focus-visible{
  outline:3px solid var(--gold);
  outline-offset:2px;
  border-radius:10px;
}
#soundToggle:active{
  transform:scale(.96);
}
/* --- inside the header nav links: sits inline in the nav --- */
header nav #soundToggle{
  align-self:center;
}
/* --- fallback: if sound.js ever has to create the button itself
   it appends it to header nav too, so this same in-flow rule
   applies; there is intentionally no fixed/absolute rule here. --- */

/* --- mobile: the toggle sits in the slim header bar beside the
   Menu button (style.css <=1100px layout), so it shrinks to a
   compact 40px icon. It is always visible — never hidden behind
   a menu. --- */
@media (max-width:1100px){
  #soundToggle{
    width:40px;
    height:40px;
    min-width:40px;
    min-height:40px;
  }
  #soundToggle .snd-icon svg{
    width:20px;
    height:20px;
  }
}

/* --- reduced motion: no transition on the toggle --- */
@media (prefers-reduced-motion: reduce){
  #soundToggle{
    transition:none;
  }
}
