.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
}

.sidebar-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 210;
  width: min(400px, 94vw);
  display: flex;
  color: var(--text-main);
  background:
    linear-gradient(180deg, rgba(245,135,43,.08), transparent 24%),
    linear-gradient(160deg, #241019 0%, #16090f 56%, #0d0709 100%);
  border-right: 1px solid rgba(242,193,78,.28);
  box-shadow: 16px 0 46px rgba(0,0,0,.68);
  transform: translateX(-104%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

.sidebar.is-open {
  transform: translateX(0);
}

.sidebar-nav {
  width: 68px;
  flex: 0 0 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(14px, env(safe-area-inset-top)) 0 0;
  background: rgba(0,0,0,.28);
  border-right: 1px solid rgba(246,239,223,.08);
}

.sidebar-nav-top {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sidebar-nav-brand {
  width: 48px;
  min-height: 34px;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.sb-btn {
  width: 54px;
  height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: rgba(246,239,223,.54);
  background: transparent;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.sb-btn.active {
  color: var(--gold);
  background:
    linear-gradient(135deg, rgba(229,50,110,.14), rgba(18,181,165,.12)),
    rgba(242,193,78,.08);
  box-shadow: inset 0 0 0 1px rgba(242,193,78,.18);
}

.sb-btn-label {
  font-size: .58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.sidebar-nav-spacer {
  flex: 1;
}

.sidebar-nav-foot {
  width: 100%;
  min-height: 58px;
  display: grid;
  place-items: center;
  border-top: 1px solid rgba(246,239,223,.08);
}

.nav-close-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246,239,223,.14);
  border-radius: 8px;
  color: var(--text-dim);
  background: rgba(246,239,223,.05);
  cursor: pointer;
}

.sidebar-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-panel {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
}

.sidebar-panel.active {
  display: flex;
}

.sidebar-panel-header {
  flex: 0 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid rgba(246,239,223,.1);
}

.sidebar-panel-title {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.sidebar-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(242,193,78,.42) transparent;
}

.rules-block {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(246,239,223,.08);
}

.rules-block:last-child {
  border-bottom: 0;
}

.rules-block h3 {
  margin: 0 0 6px;
  color: var(--fiesta-yellow);
  font-family: var(--font-title);
  font-size: 1rem;
  line-height: 1;
}

.rules-block p,
.rules-block li {
  color: var(--text-dim);
  font-size: .86rem;
  line-height: 1.45;
}

.rules-block p,
.rules-block ul {
  margin: 0;
}

.rules-block ul {
  padding-left: 18px;
}

.snd-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(246,239,223,.12);
  border-radius: 8px;
  background: rgba(246,239,223,.05);
}

.snd-row-top,
.snd-row-end {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.snd-label {
  color: var(--text-main);
  font-weight: 800;
}

.snd-pct {
  min-width: 42px;
  color: var(--text-dim);
  font-size: .8rem;
  text-align: right;
}

.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  display: inline-block;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(246,239,223,.18);
  border-radius: 999px;
  background: rgba(246,239,223,.09);
  cursor: pointer;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(246,239,223,.72);
  transition: transform .18s ease, background .18s ease;
}

.toggle-switch input:checked + .toggle-track {
  border-color: rgba(242,193,78,.6);
  background: rgba(242,193,78,.24);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(18px);
  background: var(--gold);
}

.volume-slider {
  width: 100%;
  accent-color: var(--gold);
}

.test-sfx-btn {
  width: 100%;
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(242,193,78,.22);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(242,193,78,.08);
  font-weight: 800;
  cursor: pointer;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(246,239,223,.12);
  border-radius: 8px;
  background: rgba(246,239,223,.05);
}

.profile-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
}

.profile-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-kicker {
  color: var(--gold);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.profile-copy strong {
  overflow: hidden;
  color: var(--text-main);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sidebar-footer {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: rgba(246,239,223,.42);
  border-top: 1px solid rgba(246,239,223,.08);
  font-family: var(--font-title);
  font-weight: 800;
}

@media (hover: hover) {
  .sb-btn:hover,
  .nav-close-btn:hover,
  .test-sfx-btn:hover {
    color: var(--gold);
    background: rgba(242,193,78,.1);
  }
}
