a {
  text-decoration: none;
  color: #88f;
}
a:hover {
  color: red;
}
#main {
  font-family: sans-serif;
  color: #fff;
  background: #000;
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
#main > svg {
  width: 100%;
  height: 100%;
  stroke-width: 10px;
  stroke: #fff;
  fill: none;
}
.menul {
  position: absolute;
  top: 0;
  left: 0;
}
.menur {
  position: absolute;
  top: 0;
  right: 0;
}
.red {
  color: red;
}
.blue {
  color: #88f;
}
.button,
.choice {
  padding: 1em;
  display: inline-block;
  cursor: pointer;
}
.button {
  color: #666;
}
.button:hover {
  color: #fff;
}
.button.bot,
.button.highlight {
  color: red;
}
.button.usr {
  color: #88f;
}
.choice {
  color: #444;
}
.menur .button {
  display: block;
}
.world {
  stroke: #222;
  stroke-width: 1;
}
.line {
  stroke: #333;
  pointer-events: none;
  stroke-linecap: round;
  stroke-linejoin: bevel;
}
.line.usr {
  stroke: #88f;
}
.line.usr.tmp {
  stroke: #fff;
}
.line.bot {
  stroke: red;
}
.line.bot.tmp {
  stroke: #ff0;
}
.grph {
  stroke-width: 1;
  fill: none;
}
.grph.usr {
  stroke: #88f;
}
.grph.bot {
  stroke: red;
}
.dot {
  pointer-events: all;
  stroke-width: 0.1;
  fill: #000;
  stroke: #555;
}
.dot.src {
  fill: #444;
}
.dot.bot {
  stroke: none;
  fill: red;
}
.dot.bot.src {
  fill: #ff0;
}
.dot.usr {
  stroke: none;
  fill: #88f;
}
.dot.usr.linked:hover {
  cursor: pointer;
}
.dot.usr.src {
  fill: #fff;
}
.pie {
  pointer-events: none;
  stroke: none;
  fill: #000;
}
.msg {
  text-align: center;
  padding: 1em;
  border-radius: 1em;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
}
.msg.bot {
  color: red;
  opacity: 1;
}
.msg.usr {
  color: #88f;
  opacity: 1;
}
.about,
.hint1,
.hint2,
.popup {
  line-height: 1.3;
  text-align: center;
  padding: 1em;
  border-radius: 1em;
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
}
.popup {
  pointer-events: none;
  top: 0;
  left: 0;
}
.hint1 {
  top: 30%;
}
.hint2 {
  top: 70%;
}
.about {
  line-height: 1.5;
  text-align: left;
  top: 50%;
  font-size: 24px;
  cursor: pointer;
}
.about .wahdatio,
.about .version {
  font-size: 64px;
  margin: 48px;
  text-align: center;
}
.about .version {
  font-size: 16px;
  color: #333;
}
.spark {
  stroke: none;
}
.spark.usr {
  fill: #88f;
}
.spark.bot {
  fill: red;
}

/* ---------- Phones ---------- */

html,
body {
  margin: 0;
  overscroll-behavior: none;
}

.menul,
.menur {
  z-index: 1;
  padding-top: env(safe-area-inset-top);
}

.menul {
  padding-left: env(safe-area-inset-left);
}

.menur {
  padding-right: env(safe-area-inset-right);
}

/* Menu items are touch targets: at least 44px each way */
.button,
.choice {
  min-width: 44px;
  min-height: 44px;
  box-sizing: border-box;
  text-align: center;
}

@media (max-width: 700px), (max-height: 500px) {
  /* The open options menu gets a backdrop so it reads over the sphere */
  .menul:has(.choice) {
    right: 0;
    background: rgba(0, 0, 0, 0.88);
    border-bottom: 1px solid #222;
  }

  .button,
  .choice {
    padding: 0.8em 0.7em;
  }

  /* Hints wrap to the screen, not to half of it */
  .hint1,
  .hint2 {
    width: min(88vw, 440px);
    box-sizing: border-box;
  }

  .about {
    width: min(92vw, 520px);
    max-height: 92%;
    overflow: auto;
    box-sizing: border-box;
    font-size: 16px;
  }

  .about .wahdatio {
    font-size: 40px;
    margin: 12px;
  }

  .about .version {
    margin: 16px;
  }
}
