/* Modern settings switches and the optional hitbox inspector. */
.settings-groups {
  grid-template-columns: repeat(4, minmax(190px, 1fr));
}

.liquid-decay-group {
  grid-template-columns: 1fr;
  width: 100%;
}

.settings-switch {
  --switch-accent: #43cfff;
  --switch-accent-soft: rgba(67, 207, 255, 0.28);
  width: 100%;
  min-width: 0;
  min-height: 66px;
  padding: 10px 12px 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #edf6ff;
  text-align: left;
  border: 1px solid rgba(125, 202, 255, 0.18);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(14, 36, 66, 0.92), rgba(6, 17, 34, 0.98)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 24px rgba(0, 7, 20, 0.2);
  cursor: pointer;
}

.settings-switch::before,
.settings-switch::after {
  content: none !important;
  display: none !important;
}

.settings-switch:hover {
  border-color: rgba(137, 218, 255, 0.36);
}

.settings-switch.is-on {
  border-color: var(--switch-accent);
  box-shadow: 0 0 0 1px var(--switch-accent-soft), 0 14px 30px rgba(0, 8, 24, 0.3);
}

.settings-switch-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.settings-switch-copy strong {
  color: inherit;
  font-size: 0.88rem;
  line-height: 1.1;
}

.settings-switch-copy small {
  color: #91a9c7;
  font-size: 0.7rem;
  line-height: 1.2;
}

.settings-switch.is-on .settings-switch-copy small {
  color: #bfefff;
}

.settings-switch-track {
  position: relative;
  width: 52px;
  height: 30px;
  flex: 0 0 52px;
  border: 1px solid rgba(151, 183, 219, 0.28);
  border-radius: 999px;
  background: rgba(2, 9, 20, 0.76);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.32);
  transition: background 320ms ease, border-color 320ms ease, box-shadow 320ms ease !important;
}

.settings-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f7fbff, #b9c9da);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.34);
  transform: translateX(0);
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1), background 320ms ease !important;
}

.settings-switch.is-on .settings-switch-track {
  border-color: var(--switch-accent);
  background: var(--switch-accent);
  box-shadow: 0 0 16px var(--switch-accent-soft), inset 0 1px 2px rgba(255, 255, 255, 0.34);
}

.settings-switch.is-on .settings-switch-thumb {
  transform: translateX(22px);
  background: #ffffff;
}

body[data-theme="light"] .settings-switch {
  color: #10284a;
  border-color: rgba(36, 91, 151, 0.2);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(222, 236, 251, 0.94)) !important;
  box-shadow: inset 0 1px 0 #fff, 0 10px 20px rgba(27, 67, 112, 0.1);
}

body[data-theme="light"] .settings-switch-copy small {
  color: #607da1;
}

body[data-theme="light"] .settings-switch.is-on .settings-switch-copy small {
  color: #236f9d;
}

.hitbox-canvas-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  max-width: calc(100% - 32px);
  padding: 8px 11px;
  border: 1px solid rgba(175, 214, 255, 0.2);
  border-radius: 12px;
  background: rgba(3, 10, 22, 0.82);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  color: #edf7ff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.hitbox-canvas-legend[hidden] {
  display: none !important;
}

.hitbox-canvas-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hitbox-key {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 0;
  background: currentColor;
  box-shadow: inset 0 0 0 3px rgba(3, 10, 22, 0.88);
}

.hitbox-key-red {
  color: #ff334c;
}

.hitbox-key-green {
  color: #75ff57;
}

.dom-hitbox-layer {
  z-index: 2147483646;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.dom-hitbox-layer--document {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.dom-hitbox-layer--fixed {
  position: fixed;
  inset: 0;
}

.dom-hitbox-outline {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid rgba(255, 46, 72, 0.98);
  border-radius: 0;
  background: rgba(255, 46, 72, 0.025);
  pointer-events: none;
}

.dom-hitbox-static-host {
  position: relative !important;
}

.dom-hitbox-click-target {
  position: absolute;
  z-index: 2147483645;
  display: block;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.001);
  cursor: inherit;
  pointer-events: none;
  touch-action: inherit;
  user-select: none;
}

body[data-hitboxes="true"] .dom-hitbox-click-target {
  pointer-events: auto;
}

@media (max-width: 1180px) {
  .settings-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .settings-groups {
    grid-template-columns: 1fr;
  }

  .hitbox-canvas-legend {
    left: 10px;
    bottom: 10px;
    gap: 6px 10px;
    padding: 7px 9px;
    font-size: 0.64rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .settings-switch .settings-switch-track,
  .settings-switch .settings-switch-thumb {
    transition: none !important;
  }
}
