.browserupgrade {
  margin: 0.2em 0;
  background: #ccc;
  color: #000;
  padding: 0.2em 0;
}

/* Space out content a bit */
body {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  font-family: "Poppins", sans-serif;
}

/* Everything but the jumbotron gets side spacing for mobile first views */
.header,
.marketing,
.footer {
  padding-right: 1rem;
  padding-left: 1rem;
}

/* Custom page header */
.header {
  padding-bottom: 1rem;
  border-bottom: 0.05rem solid #e5e5e5;
  /* Make the masthead heading the same height as the navigation */
}
.header h3 {
  margin-top: 0;
  margin-bottom: 0;
  line-height: 3rem;
}

.fillColor {
  display: flex;
  align-items: center;
  flex-direction: row;
}
.fillColor input {
  width: 150px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #999;
  margin-left: 20px;
}
.fillColor input:focus {
  border: 0;
  border-bottom: 1px solid #fff;
}
.fillColor i.bx-move {
  width: 10px;
  height: 10px;
  padding-left: 10px;
}

::placeholder {
  color: #444;
  font-size: 12px;
}

.clearColor {
  width: 100%;
  text-align: center;
}

.swatch {
  width: 20px;
  height: 20px;
  margin: auto;
  padding: 10px;
  border-radius: 20px;
  border: 2px solid #777;
}
.swatch:hover, .swatch.active {
  border: 2px solid #fff !important;
}

.btn {
  background-color: #a4d246;
}
.btn span {
  color: #000;
}

.toolLink {
  display: flex;
  align-items: center;
}

.mapArea {
  position: relative;
}

.row {
  margin-right: 0;
  margin-left: 0;
}

.toolbar {
  position: absolute;
  left: 50px;
  top: 50px;
  width: 200px;
  height: 500px;
  border-radius: 10px;
  background-color: #eee;
  color: #fff;
  font-family: "Poppins", sans-serif;
}
.toolbar .toolSection {
  padding: 10px;
  border-bottom: 1px solid #777;
}
.toolbar .toolSection h3 {
  font-size: 18px;
  font-weight: bold;
  padding-bottom: 20px;
}

#commentBox {
  width: 150px;
  height: 177px;
  background-color: #fff;
  border: 1px solid black;
  border-radius: 10px;
  color: #000;
  font-size: 12px;
  font-family: helvetica;
  display: none;
  position: absolute;
  padding: 10px;
  z-index: 99;
}
#commentBox h5 {
  text-align: center;
  width: 100%;
  font-size: 14px;
}
#commentBox textarea {
  width: 130px;
  margin: auto;
  height: 100px;
  overflow-y: scroll;
  padding-bottom: 10px;
}
#commentBox button {
  width: 100px;
  margin: auto;
  font-size: 12px;
  font-family: "Poppins", sans-serif;
  color: #000;
  background-color: #a4d246;
  margin-left: 15px;
}

/* Custom page footer */
.footer {
  width: 100%;
  text-align: center;
  padding-top: 50px;
  color: #777;
}

.wrapper {
  margin-left: 300px;
  position: relative;
}

canvas {
  margin: auto;
  margin-top: 50px;
}

.navOptions {
  width: 0;
  height: 0;
  overflow: hidden;
  transition: all 0.5s;
}

#navList {
  overflow: hidden;
  transition: all 0.5s;
}

#colorList {
  overflow: hidden;
  height: 0;
  transition: all 0.5s;
}

@media (max-width: 1199px) {
  #header {
    left: -300px;
  }
  .wrapper {
    margin-left: 0;
  }
  #toolDropdown {
    width: 100%;
    left: 0;
  }
}
/* Map editor */
body {
  background: #f3f5f7;
  overflow: hidden;
}

#header {
  overflow-y: auto;
  padding-bottom: 30px;
  transition: width 0.2s ease;
}

.sidebar-toggle {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 10px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid #596775;
  border-radius: 7px;
  background: #27313b;
  color: #fff;
  font-size: 23px;
}
.sidebar-toggle:hover {
  border-color: #5bc0de;
  background: #303d49;
}

.mobile-sidebar-arrow {
  display: none;
}

#header .profile .profile-logo-compact {
  display: none;
}

#header .profile .powered-by {
  margin: 3px 0 15px;
  color: #8b949e;
  font-size: 10px;
  letter-spacing: 0.03em;
  text-align: center;
}

.sidebar-content {
  padding: 0 14px;
}

.sidebar-section {
  padding: 14px 0;
  border-top: 1px solid #343a40;
}
.sidebar-section h2 {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-heading,
.map-title-row,
.dimension-row,
.form-actions {
  display: flex;
  align-items: center;
}

.section-heading,
.map-title-row {
  justify-content: space-between;
}

.visually-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon-button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #657382;
  border-radius: 6px;
  background: #27313b;
  color: #fff;
  font-size: 20px;
}

.editor-form {
  margin: 12px 0;
  padding: 12px;
  border-radius: 8px;
  background: #202a34;
  color: #dce3e9;
}
.editor-form[hidden] {
  display: none;
}
.editor-form label {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 500;
}
.editor-form input,
.editor-form select {
  width: 100%;
  min-height: 34px;
  margin-top: 3px;
  padding: 5px 7px;
  border: 1px solid #596775;
  border-radius: 4px;
  background: #fff;
  color: #111;
}
.editor-form input[type=color] {
  padding: 2px;
}
.editor-form input[type=checkbox] {
  width: auto;
  min-height: 0;
  margin: 0 6px 0 0;
}
.editor-form small {
  display: block;
  margin: -3px 0 9px;
  color: #aeb9c3;
  line-height: 1.35;
}

.checkbox-label {
  display: flex !important;
  align-items: flex-start;
}

.dimension-row {
  gap: 8px;
}
.dimension-row label {
  flex: 1;
}

.form-actions {
  gap: 5px;
}
.form-actions .btn {
  padding: 5px 10px;
  font-size: 12px;
}
.form-actions .btn-link {
  color: #cbd3da;
}

.map-list,
.palette-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.map-entry,
.palette-entry,
.tool-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #222b35;
  color: #e9eef2;
  text-align: left;
}
.map-entry:hover, .map-entry.active,
.palette-entry:hover,
.palette-entry.active,
.tool-button:hover,
.tool-button.active {
  border-color: #5bc0de;
  background: #303d49;
}

.map-entry {
  display: grid;
  grid-template-columns: 22px 1fr auto 22px 18px;
  align-items: center;
  padding: 9px;
}
.map-entry small {
  color: #aeb9c3;
}

.edit-map-entry,
.delete-map-entry {
  color: #b9c3cc;
  text-align: center;
}
.edit-map-entry:hover,
.delete-map-entry:hover {
  color: #77d4ee;
}

.delete-map-entry {
  font-size: 20px;
}
.delete-map-entry:hover {
  color: #ff7b7b;
}

.palette-entry {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 14px 22px 18px;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 6px;
}
.palette-entry img,
.palette-entry .token-symbol {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  object-fit: cover;
}
.palette-entry .token-symbol {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  text-shadow: 0 1px 2px #000;
}
.palette-entry .token-symbol.color-only {
  border-radius: 7px;
  text-shadow: none;
}

.palette-copy {
  min-width: 0;
}
.palette-copy strong,
.palette-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-copy small {
  color: #b9c3cc;
  font-size: 10px;
}

.color-chip {
  width: 14px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.passability.blocked {
  color: #ffb0b0;
  font-weight: 600;
}

.passability.passable {
  color: #9de0ae;
}

.edit-entry,
.remove-entry {
  color: #b9c3cc;
  text-align: center;
}
.edit-entry:hover,
.remove-entry:hover {
  color: #77d4ee;
}

.remove-entry {
  font-size: 20px;
}
.remove-entry:hover {
  color: #ff7b7b;
}

.board-tools {
  display: grid;
  gap: 6px;
}
.board-tools h2 {
  margin-bottom: 5px;
}

.tool-button {
  padding: 8px 10px;
}

.background-upload {
  margin: 0;
  cursor: pointer;
  font-weight: 400;
}

.map-background-actions {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}
.map-background-actions .tool-button {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 8px 10px;
  box-sizing: border-box;
  font: inherit;
  line-height: 1.2;
}
.map-background-actions[hidden] {
  display: none;
}

.wrapper {
  width: auto;
  height: 100vh;
  margin-left: 300px;
  padding: 22px;
  overflow: hidden;
  transition: margin-left 0.2s ease;
}

@media (min-width: 1200px) {
  .sidebar-collapsed #header {
    width: 64px;
    overflow: hidden;
  }
  .sidebar-collapsed #header .profile {
    padding-top: 58px;
  }
  .sidebar-collapsed #header .profile .profile-logo-full {
    display: none;
  }
  .sidebar-collapsed #header .profile .profile-logo-compact {
    display: block;
    width: 44px;
    height: 44px !important;
    max-width: 44px;
    margin: 0 auto;
    box-sizing: border-box;
    border-width: 3px;
    object-fit: contain;
    object-position: center;
    aspect-ratio: 1/1;
    image-rendering: pixelated;
  }
  .sidebar-collapsed #header .profile h1 {
    display: none;
  }
  .sidebar-collapsed #header .profile .powered-by {
    display: none;
  }
  .sidebar-collapsed .sidebar-content {
    display: none;
  }
  .sidebar-collapsed .sidebar-toggle {
    right: 16px;
  }
  .sidebar-collapsed .wrapper {
    margin-left: 64px;
  }
}
.map-title-row {
  min-height: 72px;
  gap: 15px;
}
.map-title-row h1 {
  margin: 0;
  color: #1d2833;
  font-size: 25px;
  font-weight: 600;
}
.map-title-row p {
  margin: 3px 0 0;
  color: #5d6872;
  font-size: 13px;
}
.map-title-row p.error {
  color: #b42318;
  font-weight: 600;
}

.map-viewport {
  position: relative;
  display: grid;
  width: 100%;
  height: calc(100vh - 116px);
  place-items: center;
  overflow: auto;
  border: 1px solid #d4d9de;
  border-radius: 10px;
  background-color: #dce1e5;
  background-image: linear-gradient(45deg, #d2d8dd 25%, transparent 25%), linear-gradient(-45deg, #d2d8dd 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d2d8dd 75%), linear-gradient(-45deg, transparent 75%, #d2d8dd 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.map-viewport.has-map-background {
  background-color: #202830;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.comment-tooltip {
  position: absolute;
  z-index: 4;
  width: max-content;
  max-width: 220px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #18222b;
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  pointer-events: none;
  white-space: pre-wrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
.comment-tooltip[hidden] {
  display: none;
}

.empty-map-message {
  padding: 28px 40px;
  border: 2px dashed #9ba7b1;
  border-radius: 10px;
  color: #52606c;
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 600;
  text-align: center;
}
.empty-map-message[hidden] {
  display: none;
}

.comment-dialog {
  width: min(440px, 100vw - 30px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}
.comment-dialog::backdrop {
  background: rgba(13, 22, 30, 0.62);
}
.comment-dialog form {
  padding: 18px;
}
.comment-dialog h2 {
  margin: 0;
  color: #1d2833;
  font-size: 20px;
}
.comment-dialog textarea {
  width: 100%;
  min-height: 160px;
  margin: 15px 0;
  padding: 10px;
  border: 1px solid #aeb7bf;
  border-radius: 6px;
  resize: vertical;
}

.comment-heading,
.comment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comment-heading .icon-button {
  border-color: #c8cfd5;
  background: #eef1f3;
  color: #25313b;
}

#canvasMap {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  background: #fff;
  box-shadow: 0 5px 22px rgba(0, 0, 0, 0.2);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

@media (max-width: 1199px) {
  body {
    overflow: auto;
  }
  .wrapper {
    width: 100%;
    margin-left: 0;
    padding: 14px;
  }
  .desktop-sidebar-toggle {
    display: none;
  }
  .mobile-sidebar-arrow {
    position: fixed;
    z-index: 10000;
    top: 12px;
    right: auto;
    left: 12px;
    display: grid;
    transition: left 0.2s ease;
  }
  .mobile-nav-active .mobile-sidebar-arrow {
    left: 256px;
  }
}