* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #06080d;
  overflow: hidden;
}
body {
  font-family:
    "Trebuchet MS",
    "Segoe UI",
    Verdana,
    Arial,
    sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: #eaf1f5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  user-select: none;
  -webkit-user-select: none;
  --panel: rgba(16, 20, 30, 0.93);
  --edge: #3a5470;
  --edge-soft: #2a3346;
  --slot: #0f1421;
  --accent: #57d6c4;
  --gold: #f2c058;
}
button {
  font: inherit;
}
.hidden {
  display: none !important;
}
#game {
  position: relative;
  width: 100%;
  height: 100%;
}
#game::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  box-shadow: inset 0 0 220px 30px rgba(6, 10, 18, 0.6), inset 0 0 60px 0 rgba(6, 10, 18, 0.25);
}
#view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: default;
}
#view.use-mode {
  cursor: crosshair;
}
#overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 6;
}
.label {
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 0 3px #05070c, 0 1px 2px #05070c;
}
.label .name {
  font-size: 11px;
}
.label .name.player {
  color: #fff;
}
.label .name.monster {
  color: #ffd54a;
}
.label .name.npc {
  color: #7ad0ff;
}
.label .name.me {
  color: #7fff7f;
}
.label .name.skull::before {
  content: "☠";
  display: inline-block;
  font-size: 21px;
  line-height: 1;
  margin-right: 5px;
  vertical-align: -3px;
  color: #fff;
  text-shadow:
    -1px -1px 0 #281d20,
    1px -1px 0 #281d20,
    -1px 1px 0 #281d20,
    1px 1px 0 #281d20;
}
.label .hpbar {
  width: 34px;
  height: 4px;
  margin: 1px auto 0;
  background: #400;
  border: 1px solid #000;
}
.label .hpbar div {
  height: 100%;
  background: #4c4;
}
.label .say {
  color: #ffff40;
  font-size: 12px;
  max-width: 220px;
  white-space: normal;
  margin-bottom: 2px;
}
.label .say.spell {
  color: #ff9040;
}
.splat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #c00;
  color: #fff;
  font-size: 11px;
  line-height: 24px;
  text-align: center;
  pointer-events: none;
  border: 1px solid #400;
}
.float {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #ffd54a;
  pointer-events: none;
  font-size: 12px;
  animation: floatup 1.2s ease-out forwards;
}
@keyframes floatup {
  from {
    opacity: 1;
    margin-top: 0;
  }
  to {
    opacity: 0;
    margin-top: -40px;
  }
}
.paint-repeat-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  cursor: pointer;
}
.paint-repeat-option input {
  min-width: 22px;
  min-height: 22px;
}
#paint-brush {
  position: absolute;
  z-index: 25;
  top: calc(90px + var(--safe-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(520px, calc(100% - 24px));
  box-sizing: border-box;
  padding: 8px 10px;
  border: 2px solid #78542c;
  border-left: 10px solid var(--paint-colour);
  border-radius: 6px;
  background: #fff7df;
  color: #352514;
  font: 12px/1.4 sans-serif;
  pointer-events: auto;
  box-shadow: 0 2px 7px #0005;
}
#paint-brush[hidden] {
  display: none;
}
#paint-brush span {
  min-width: 0;
  flex: 1;
}
#paint-brush button {
  flex-shrink: 0;
  min-height: 44px;
  padding: 6px 10px;
  color: #352514;
  background: #f2d18c;
  border: 1px solid #78542c;
  border-radius: 4px;
  cursor: pointer;
}
@media (max-width: 900px) and (pointer: coarse) {
  #paint-brush {
    top: calc(14px + 114px * var(--hud-scale, 1) + env(safe-area-inset-top));
    width: min(520px, calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  }
}
