:root {
  color-scheme: dark;
  font-family: "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: #000306;
  color: #dff4ff;
  --signal: #61bdff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000306;
}

body {
  min-height: 100svh;
}

button,
input,
select {
  font: inherit;
}

.stage,
#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage {
  isolation: isolate;
  overflow: hidden;
  background: #000306;
}

#field {
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.panel-toggle {
  position: fixed;
  z-index: 3;
  right: 18px;
  bottom: 17px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(132, 195, 232, 0.13);
  border-radius: 50%;
  background: rgba(8, 24, 34, 0.42);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: opacity 220ms ease, right 280ms cubic-bezier(.4, 0, .2, 1), border-color 180ms ease;
}

.panel-toggle:hover,
.panel-toggle:focus-visible {
  border-color: rgba(142, 211, 250, 0.36);
  outline: none;
}

.panel-toggle span,
.panel-toggle span::before,
.panel-toggle span::after {
  display: block;
  width: 12px;
  height: 1px;
  background: rgba(185, 226, 248, 0.5);
  content: '';
}

.panel-toggle span {
  position: relative;
}

.panel-toggle span::before,
.panel-toggle span::after {
  position: absolute;
  left: 0;
}

.panel-toggle span::before {
  top: -4px;
  width: 8px;
}

.panel-toggle span::after {
  top: 4px;
  width: 5px;
}

#controls {
  --sh-bg: rgba(2, 8, 13, 0.93);
  --sh-border: rgba(100, 190, 242, 0.09);
  --sh-text: rgba(221, 244, 255, 0.9);
  --sh-text-dim: rgba(162, 210, 238, 0.46);
  --sh-text-mid: rgba(182, 224, 247, 0.66);
  --sh-surface: rgba(93, 182, 235, 0.08);
  --sh-surface-hover: rgba(100, 193, 249, 0.13);
  --sh-accent: rgba(110, 202, 255, 0.82);
  --sh-width: 304px;
}

#controls .sh-panel-body {
  padding-top: 4px;
}

body > .sh-panel-hint {
  display: none;
}

#controls .sh-slider input[type="range"]::-webkit-slider-thumb {
  background: #a9ddff;
  box-shadow: 0 0 9px rgba(69, 178, 255, 0.45);
}

#controls .sh-slider input[type="range"]::-moz-range-thumb {
  background: #a9ddff;
  box-shadow: 0 0 9px rgba(69, 178, 255, 0.45);
}

#controls .sh-switch input:checked + .sh-knob::after {
  background: #a9ddff;
}

.panel-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 19px 18px 8px;
  border-bottom: 1px solid rgba(97, 189, 255, 0.06);
  -webkit-user-select: none;
  user-select: none;
}

.panel-meta span {
  color: rgba(113, 195, 242, 0.42);
  font: 600 8px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.22em;
}

.panel-meta strong {
  color: rgba(222, 244, 255, 0.82);
  font-size: 15px;
  font-weight: 450;
  letter-spacing: -0.01em;
}

html:has(.sh-panel:not(.collapsed)) .panel-toggle {
  right: 320px;
  opacity: 0.46;
}

@media (max-width: 720px) {
  #controls {
    --sh-width: min(304px, 78vw);
    max-width: 78vw;
  }

  html:has(.sh-panel:not(.collapsed)) .panel-toggle {
    right: calc(min(304px, 78vw) + 10px);
    opacity: 0.72;
  }
}

@media (max-height: 620px) {
  .panel-toggle {
    bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel-toggle {
    transition: none;
  }
}
