:root {
  color-scheme: dark;
  --ink: #0b0d0c;
  --paper: #e9ebe4;
  --acid: #eaff3f;
  --muted: #8e958b;
  --line: #3a3f3a;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html, body, #app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
}
button, input, select, textarea {
  font: inherit;
}
button {
  color: inherit;
}
#app {
  position: relative;
  isolation: isolate;
}
#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: #0b0d0c;
}
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.15;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}
.topbar {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(18px + env(safe-area-inset-top)) 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ffffff17;
  background: linear-gradient(#0b0d0ce8, #0b0d0c00);
}
.brand {
  color: var(--paper);
  text-decoration: none;
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.18em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: var(--ink);
  background: var(--acid);
  font-size: 22px;
  font-family: Georgia, serif;
  font-style: italic;
  transform: rotate(-4deg);
}
.connection {
  border: 1px solid var(--line);
  background: #111411;
  padding: 8px 10px;
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 9px;
  letter-spacing: 0.14em;
}
.connection small {
  padding-left: 7px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.connection.online small {
  color: var(--paper);
}
.connection span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f0a22e;
}
.connection.online span {
  background: var(--acid);
  box-shadow: 0 0 10px var(--acid);
}
.location-card {
  z-index: 3;
  position: absolute;
  top: calc(79px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 480px);
  display: flex;
  gap: 12px;
  align-items: center;
  background: #151815e9;
  border: 1px solid #3c433a;
  padding: 11px 12px;
  box-shadow: 0 12px 30px #0008;
}
.location-card.hidden {
  display: none;
}
.location-card .crosshair {
  color: var(--acid);
  font-size: 23px;
}
.location-card div {
  min-width: 0;
  flex: 1;
}
.location-card strong, .location-card small {
  display: block;
}
.location-card strong {
  font-size: 11px;
  letter-spacing: 0.1em;
}
.location-card small {
  color: var(--muted);
  margin-top: 3px;
  font-size: 9px;
}
.location-card button {
  border: 0;
  background: var(--acid);
  color: var(--ink);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 9px 10px;
}
.coordinates {
  position: absolute;
  z-index: 2;
  left: 17px;
  bottom: calc(104px + env(safe-area-inset-bottom));
  font-size: 9px;
  letter-spacing: 0.15em;
  color: #b8bdb4;
}
.heading-readout {
  position: absolute;
  z-index: 2;
  left: 17px;
  bottom: calc(128px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--acid);
}
.heading-readout i {
  font-style: normal;
  font-size: 24px;
  transform-origin: center;
  transition: transform 0.12s linear;
}
.heading-readout span {
  display: grid;
}
.heading-readout b {
  font-size: 11px;
  letter-spacing: 0.15em;
}
.heading-readout small {
  font-size: 7px;
  letter-spacing: 0.11em;
  color: #8e958b;
  margin-top: 2px;
}
.scale {
  position: absolute;
  z-index: 2;
  right: 17px;
  bottom: calc(105px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: #9ea49b;
}
.scale i {
  width: 20px;
  border-top: 2px solid var(--paper);
  position: relative;
}
.scale i:after, .scale i:before {
  content: '';
  position: absolute;
  top: -4px;
  height: 6px;
  border-left: 1px solid var(--paper);
}
.scale i:before {
  left: 0;
}
.scale i:after {
  right: 0;
}
.toolbar {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  height: 73px;
  width: min(94%, 430px);
  padding: 7px 11px;
  background: #151815ee;
  border: 1px solid #41463e;
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr 1fr 1fr;
  align-items: center;
  box-shadow: 0 15px 35px #000;
}
.tool {
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  gap: 4px;
  color: #737a71;
}
.tool span {
  font-size: 21px;
}
.tool small {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.tool.active {
  color: var(--paper);
}
.tool.active#spectateButton {
  color: var(--acid);
  text-shadow: 0 0 14px #eaff3f88;
}
.draw-trigger {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  justify-self: center;
  margin-top: -31px;
  border: 2px solid var(--ink);
  outline: 1px solid #50564d;
  background: var(--paper);
  color: var(--ink);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  box-shadow: 0 4px 0 var(--acid);
}
.draw-trigger span {
  width: 19px;
  height: 19px;
  background: var(--ink);
  border-radius: 50%;
}
.draw-trigger b {
  font-size: 7px;
  letter-spacing: 0.14em;
}
.draw-trigger.active {
  background: var(--acid);
  box-shadow: 0 0 24px #eaff3f55;
}
.brush-panel {
  position: absolute;
  z-index: 3;
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(94%, 520px);
  background: #171a17f5;
  border: 1px solid #42483f;
  padding: 13px;
  display: grid;
  grid-template-columns: 1fr 2fr auto auto;
  gap: 10px;
  align-items: end;
}
.brush-panel[hidden] {
  display: none;
}
.brush-panel label {
  font-size: 8px;
  letter-spacing: 0.14em;
  color: #9ba095;
  display: grid;
  gap: 6px;
}
.brush-panel input[type='color'] {
  width: 44px;
  height: 25px;
  border: 0;
  padding: 0;
  background: none;
}
.brush-panel input[type='range'] {
  accent-color: var(--acid);
  width: 100%;
}
.brush-panel button {
  border: 1px solid #464b44;
  background: #20231f;
  font-size: 8px;
  letter-spacing: 0.1em;
  padding: 9px;
}
.brush-panel .publish {
  grid-column: 1/-1;
  border: 0;
  background: var(--acid);
  color: var(--ink);
  font-weight: 900;
}
.publish span {
  display: inline-grid;
  place-items: center;
  margin-left: 4px;
  background: var(--ink);
  color: var(--acid);
  border-radius: 50%;
  width: 17px;
  height: 17px;
}
.toast {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateY(10px);
  opacity: 0;
  pointer-events: none;
  background: var(--paper);
  color: var(--ink);
  padding: 11px 16px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%);
}
dialog {
  border: 1px solid #4d534b;
  background: #131613;
  color: var(--paper);
  width: min(90%, 420px);
  padding: 0;
  box-shadow: 0 30px 90px #000;
}
dialog::backdrop {
  background: #050605cc;
  backdrop-filter: blur(3px);
}
dialog form {
  padding: 19px;
  display: grid;
  gap: 18px;
}
dialog header {
  display: flex;
  justify-content: space-between;
  font-weight: 900;
  letter-spacing: 0.14em;
  font-size: 12px;
  border-bottom: 1px solid #343932;
  padding-bottom: 14px;
}
dialog header button {
  border: 0;
  background: none;
  font-size: 24px;
  line-height: 12px;
}
dialog p {
  color: #a3a99f;
  font-size: 11px;
  line-height: 1.5;
  margin: 0;
}
dialog label {
  font-size: 8px;
  letter-spacing: 0.13em;
  display: grid;
  gap: 7px;
}
dialog label small {
  color: #71776f;
}
dialog select, dialog textarea {
  background: #20241f;
  color: var(--paper);
  border: 1px solid #454b42;
  padding: 10px;
}
dialog textarea {
  height: 75px;
  resize: vertical;
}
.dialog-submit {
  border: 0;
  background: var(--acid);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 13px;
}
.toggle {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.privacy {
  border-left: 3px solid var(--acid);
  padding-left: 12px;
}
.high-contrast #canvas {
  background: #000;
}
@media (max-width: 540px) {
  .brush-panel {
    grid-template-columns: 55px 1fr auto auto;
  }
  .topbar {
    padding-left: 15px;
    padding-right: 15px;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  .toolbar {
    left: auto;
    right: 15px;
    bottom: 15px;
    transform: none;
    width: 79px;
    height: auto;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .draw-trigger {
    margin: 0;
  }
  .brush-panel {
    left: 15px;
    bottom: 15px;
    transform: none;
    width: 250px;
    grid-template-columns: 55px 1fr;
  }
  .coordinates {
    bottom: 15px;
  }
  .scale {
    bottom: 15px;
    right: 110px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
