* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --bg: #F5F5F7;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-2: rgba(255, 255, 255, 0.76);
  --text: #1D1D1F;
  --muted: rgba(29, 29, 31, 0.62);
  --line: rgba(29, 29, 31, 0.1);
  --line-2: rgba(29, 29, 31, 0.18);
  --button-bg: #1D1D1F;
  --button-text: #FFFFFF;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.14);
  --radius: 12px;
  --accent: #1D1D1F;
}
html.neo-mode {
  color-scheme: dark;
  --bg: #050607;
  --panel: #0f0f10;
  --panel-2: #141416;
  --text: #F5F5F7;
  --muted: rgba(245, 245, 247, 0.62);
  --line: rgba(245, 245, 247, 0.12);
  --line-2: rgba(245, 245, 247, 0.18);
  --button-bg: #F5F5F7;
  --button-text: #050607;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --accent: #F5F5F7;
}
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
canvas { display: block; }
button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
#logo {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  height: 60px;
  z-index: 10;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
  filter: invert(1);
}
html.neo-mode #logo { filter: none; }
.hambtn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--button-bg);
  color: var(--button-text);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.hambtn:active { transform: translateY(1px); }
.hambtn svg { width: 20px; height: 20px; }
#edgeHotspot {
  position: fixed;
  top: 0;
  right: 0;
  width: 16px;
  height: 100vh;
  z-index: 1099;
}
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(1px);
  z-index: 1098;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.backdrop.is-open { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(420px, 92vw);
  background: var(--panel);
  color: var(--text);
  z-index: 1101;
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
}
.drawer.is-open { transform: translateX(0); }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer__title, .mitem__label, .mitem__btn {
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.drawer__title { font-size: 12px; opacity: 0.85; }
.drawer__close {
  background: transparent;
  color: var(--muted);
  border: 0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.drawer__body {
  padding: 14px;
  overflow: auto;
  gap: 10px;
  display: flex;
  flex-direction: column;
}
.mitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}
.mitem__btn {
  appearance: none;
  border: 0;
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.msep { height: 1px; background: var(--line); margin: 2px 0 8px; }
.section-title {
  opacity: 0.7;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 4px 2px 6px;
}
.switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line-2);
}
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch__knob {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.24);
}
.switch input:checked + .switch__knob { transform: translateX(20px); background: var(--accent); }
#statsCard {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.4;
}
#loading, #info-text {
  color: var(--text);
}
#info-text {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#info-text .drop-callout {
  color: var(--accent);
  font-weight: 800;
}
@media (max-width: 600px) {
  #logo { top: 16px; height: 48px; }
  .hambtn { top: 12px; right: 12px; width: 40px; height: 40px; }
  .drawer__body { padding-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    scroll-behavior: auto;
    transition-duration: 0.01ms;
  }
}
