/* Leitura do campo: a mesma paleta dos menus, com contraste para a partida. */
#minimap {
  width: var(--hud-radar, 84px);
  height: var(--hud-radar, 84px);
  display: block;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #171c19;
  color: #d6f266;
  box-shadow: 0 3px 14px #0004;
  filter: none;
  -webkit-tap-highlight-color: transparent;
}

#minimap kbd:not(.pad-on),
#minimap::after {
  position: absolute;
  right: 0;
  bottom: 0;
  min-width: 17px;
  padding: 2px 4px;
  background: #252f24;
  border: 1px solid #8d9d6f77;
  border-radius: 3px;
  color: #d6f266;
  font: 700 8px monospace;
}

#minimap:hover {
  box-shadow: 0 0 0 2px #d6f26655, 0 4px 18px #0006;
}

#minimap:focus-visible,
#mm-close:focus-visible {
  outline: 2px solid #ff824c;
  outline-offset: 4px;
}

#mm-overlay {
  background: #101611a6;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

#mm-panel {
  width: min(840px, 100%);
  max-width: 100%;
  min-width: 0;
  padding: 18px;
  gap: 14px;
  border: 1px solid #667153;
  border-radius: 8px;
  background: #171e18;
  box-shadow: 0 24px 100px #0007;
  color: #f3f0df;
}

.mm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #d6f26621;
}

.mm-eyebrow {
  display: block;
  color: #a8b39a;
  font-size: 8px;
  letter-spacing: 2px;
  font-weight: 650;
  margin-bottom: 3px;
}

#mm-title {
  margin: 0;
  text-transform: uppercase;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -.9px;
  font-weight: 850;
  color: #f3f0df;
}

#mm-title span {
  color: #d6f266;
  font: 700 8px monospace;
  letter-spacing: 1px;
  vertical-align: middle;
  white-space: nowrap;
  margin-left: 6px;
}

#mm-close {
  position: static;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #d6f266;
  background: #d6f266;
  color: #1c2519;
  border-radius: 4px;
  padding: 9px 12px;
  min-height: 34px;
  font: 750 10px "Segoe UI", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: .7px;
  box-shadow: none;
}

#mm-close:hover {
  background: #e6ff8e;
  border-color: #e6ff8e;
  transform: none;
}

#mm-close kbd:not(.pad-on) {
  color: #485434;
  font: 700 9px monospace;
  border: 1px solid #1c251933;
  border-radius: 2px;
  padding: 2px 3px;
}

#mm-panel canvas {
  flex: none;
  max-width: 100%;
  border-radius: 3px;
  background: #202922;
}

.mm-legend {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 18px;
  padding-top: 10px;
  border-top: 1px solid #d6f26621;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 600;
}

.mm-legend .lg {
  white-space: nowrap;
}

.mm-legend .lg.y {
  color: #d6f266;
}

.mm-legend .lg.r {
  color: #ff9177;
}

.mm-legend .lg.h {
  color: #f1a2b7;
}

.mm-legend .lg.b {
  color: #95bb61;
}

.mm-legend .lg.s {
  color: #ff824c;
}

.mm-legend .lg.v {
  color: #c4db7d;
}

.mm-legend .lg.g {
  color: #71d8db;
}

.mm-note {
  margin: 0;
  color: #85917b;
  font-size: 8px;
  letter-spacing: .6px;
  text-align: center;
}

@media (max-width:650px) {
  #mm-panel {
    padding: 12px;
    gap: 10px;
  }

  .mm-header {
    gap: 10px;
    padding-bottom: 9px;
  }

  #mm-title {
    font-size: 20px;
  }

  #mm-title span {
    display: none;
  }

  #mm-close {
    padding: 8px 10px;
    gap: 8px;
  }

  .mm-legend {
    gap: 5px 14px;
    font-size: 9px;
    padding-top: 8px;
  }
}

@media (max-height:520px) {
  #mm-overlay {
    padding: max(8px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  #mm-panel {
    width: min(700px, 100%);
    padding: 10px 14px;
    gap: 8px;
  }

  .mm-header {
    padding-bottom: 7px;
  }

  .mm-eyebrow {
    font-size: 7px;
    margin-bottom: 2px;
  }

  #mm-title {
    font-size: 19px;
  }

  #mm-close {
    min-height: 30px;
    padding: 7px 10px;
  }

  .mm-legend {
    font-size: 8px;
    gap: 4px 14px;
    padding-top: 6px;
  }

  .mm-note {
    display: none;
  }
}

@media (pointer:coarse) {

  #minimap kbd:not(.pad-on),
  #mm-close kbd:not(.pad-on) {
    display: none;
  }

  #minimap::after {
    content: "+";
    font-size: 10px;
  }

  body.gamepad-active #minimap::after {
    content: none;
  }
}