*,
::before,
::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

button {
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

input {
  font: inherit;
}

::-webkit-scrollbar {
  display: none;
}

:root {
  --color-font: #ededed;
  --color-group-header-font: #9a9a9a;
  --color-number-icon: #dadada;
  --color-input-border: #a5a5a5;
  --color-panel-background: #363636;
  --color-panel-header-background: #323232;
  --color-panel-border: #2e2e2e;
  --color-panel-group-border: #2a2a2a;
  --color-selected: #575757;
}

body {
  background: #080d1a;
  color: var(--color-font);
}

.Field {
  --positive: #fb7185;
  --negative: #38bdf8;
  --amber: #fbbf24;
  --teal: #2dd4bf;
  --emerald: #34d399;
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #080d1a;
  color: var(--color-font);
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  user-select: none;
  touch-action: none;
}
.Field-Canvas {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: none;
}
.Field-Particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  touch-action: none;
}
.Field-Hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.Field-Hint-Primary {
  color: #475569;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
}
.Field-Hint-Secondary {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-align: center;
}
.Field:not([data-empty]) .Field-Hint {
  display: none;
}

.SinglePanel {
  position: absolute;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  background: var(--color-panel-background);
  border: 1px solid var(--color-panel-border);
  border-radius: 12px;
  overflow: hidden;
}
.SinglePanel-Header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  height: 32px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.SinglePanel-Header:active {
  cursor: grabbing;
}
.SinglePanel-Title {
  display: flex;
  align-items: center;
  height: 32px;
  background: var(--color-panel-header-background);
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-font);
  border-bottom-right-radius: 12px;
}
.SinglePanel-Title[data-end] {
  padding: 0 16px;
}
.SinglePanel-Main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  touch-action: pan-y;
}
.SinglePanel-Resize {
  position: absolute;
  z-index: 1;
  touch-action: none;
}
.SinglePanel-Resize[data-direction=n] {
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  cursor: ns-resize;
}
.SinglePanel-Resize[data-direction=s] {
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  cursor: ns-resize;
}
.SinglePanel-Resize[data-direction=e] {
  top: 0;
  right: 0;
  bottom: 0;
  width: 6px;
  cursor: ew-resize;
}
.SinglePanel-Resize[data-direction=w] {
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  cursor: ew-resize;
}
.SinglePanel-Resize[data-direction=ne] {
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  z-index: 2;
  cursor: nesw-resize;
}
.SinglePanel-Resize[data-direction=nw] {
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  z-index: 2;
  cursor: nwse-resize;
}
.SinglePanel-Resize[data-direction=se] {
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  z-index: 2;
  cursor: nwse-resize;
}
.SinglePanel-Resize[data-direction=sw] {
  bottom: 0;
  left: 0;
  width: 12px;
  height: 12px;
  z-index: 2;
  cursor: nesw-resize;
}

.ModePanel {
  width: 180px;
  left: 16px;
  top: 16px;
}

.ControlPanel {
  width: 244px;
  left: 212px;
  top: 16px;
}

.SettingPanel {
  width: 220px;
  left: 16px;
  top: 380px;
}

.PanelGroup + .PanelGroup {
  border-top: 1px solid var(--color-panel-group-border);
}
.PanelGroup-Header {
  display: flex;
  height: 28px;
  padding: 9px 12px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-group-header-font);
}

.RightLabelGrid {
  display: grid;
  grid-template-columns: max-content 1fr;
  padding: 8px 12px;
}
.RightLabelGrid-Row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1/-1;
  align-items: center;
  height: 36px;
  column-gap: 8px;
}
.RightLabelGrid-Row-Label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-font);
  padding: 0 12px;
}

.ToggleInput,
.NumberInput {
  justify-self: start;
}

.SelectList {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
}
.SelectList-Item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-font);
  cursor: pointer;
  user-select: none;
}
.SelectList-Item[data-selected] {
  background-color: var(--color-selected);
  border-radius: 2px;
}
.SelectList-Item[disabled] {
  cursor: default;
  opacity: 0.3;
}

.NumberInput {
  display: flex;
  align-items: center;
  gap: 4px;
}
.NumberInput-Arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: var(--color-number-icon);
  cursor: pointer;
}
.NumberInput-Arrow[data-disabled] {
  opacity: 0.3;
  cursor: default;
}
.NumberInput-Field {
  display: flex;
  align-items: center;
  gap: 4px;
}
.NumberInput-Input {
  width: 48px;
  height: 24px;
  padding: 0 4px;
  border: 1px solid var(--color-input-border);
  border-radius: 2px;
  background: transparent;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-font);
  text-align: center;
}
.NumberInput-Input:focus {
  outline: none;
}
.NumberInput-Unit {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-font);
  user-select: none;
}

.ToggleInput {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}
.ToggleInput-Option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-font);
  user-select: none;
}
.ToggleInput [data-selected]::before, .ToggleInput [data-selected]::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  pointer-events: none;
}
.ToggleInput [data-selected]::before {
  left: 0;
  border-left: 1px solid var(--color-input-border);
  border-top: 1px solid var(--color-input-border);
  border-bottom: 1px solid var(--color-input-border);
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
}
.ToggleInput [data-selected]::after {
  right: 0;
  border-right: 1px solid var(--color-input-border);
  border-top: 1px solid var(--color-input-border);
  border-bottom: 1px solid var(--color-input-border);
  border-top-right-radius: 2px;
  border-bottom-right-radius: 2px;
}

.ControlPanel-Item {
  padding-bottom: 4px;
}
.ControlPanel-Head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  padding: 9px 12px 0;
}
.ControlPanel-Identity {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ControlPanel-Label {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-group-header-font);
}
.ControlPanel-Dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: var(--control-accent);
  box-shadow: 0 0 10px var(--control-accent);
}
.ControlPanel-MagnetBar {
  display: flex;
  width: 18px;
  height: 7px;
  border-radius: 9999px;
  overflow: hidden;
}
.ControlPanel-MagnetBar-South {
  flex: 1;
  background: var(--negative);
}
.ControlPanel-MagnetBar-North {
  flex: 1;
  background: var(--positive);
}
.ControlPanel-Remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--color-group-header-font);
  cursor: pointer;
  visibility: hidden;
}
.ControlPanel-Item:hover .ControlPanel-Remove {
  visibility: visible;
}
.ControlPanel-Flip {
  justify-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--color-input-border);
  border-radius: 2px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-font);
  cursor: pointer;
}
.ControlPanel-Empty {
  padding: 16px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-group-header-font);
}
.ControlPanel-Item[data-mode=electric][data-sign="1"] {
  --control-accent: var(--positive);
}
.ControlPanel-Item[data-mode=electric][data-sign="-1"] {
  --control-accent: var(--negative);
}
.ControlPanel-Item[data-mode=gravity] {
  --control-accent: var(--amber);
}
.ControlPanel-Item[data-mode=vortex] {
  --control-accent: var(--teal);
}
.ControlPanel-Item[data-mode=flow] {
  --control-accent: var(--emerald);
}
.ControlPanel-Item[data-mode=current] {
  --control-accent: var(--amber);
}
.ControlPanel-Item[data-mode=dipole] {
  --control-accent: var(--positive);
}
.ControlPanel-Item[data-mode=uniform] {
  --control-accent: var(--teal);
}