.desktop-hud .hud-map {
  pointer-events: auto;
  cursor: pointer;
}

.desktop-hud .hud-map canvas:focus-visible {
  outline: 2px solid #f2f2ef;
  outline-offset: 4px;
}

#tactical-map {
  z-index: 22;
  padding-block: max(22px, env(safe-area-inset-top));
}

#tactical-map .results-shell {
  width: min(1080px, 100%);
  height: 100%;
  gap: 20px;
  text-align: left;
}

.tactical-content {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(24px, 5vw, 60px);
  flex: 1;
  min-height: 0;
}

.tactical-overview .eyebrow {
  color: #d6e2cb;
  font-size: 9px;
  letter-spacing: 0.24em;
}

#tactical-map-title {
  color: var(--accent);
  font:
    700 clamp(52px, 8vh, 96px)/0.95 Barlow,
    sans-serif;
  letter-spacing: 0.025em;
  margin: 12px 0 18px;
}

.tactical-overview > p {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: #c3cec0;
}

.tactical-brief {
  margin: 30px 0 24px;
  display: grid;
  gap: 18px;
}

.tactical-brief > div {
  border-bottom: 1px solid #dce6cf26;
  padding-bottom: 10px;
}

.tactical-brief dt {
  color: #9eae9e;
  font-size: 8px;
  letter-spacing: 0.16em;
}

.tactical-brief dd {
  margin: 5px 0 0;
  color: #edf2d8;
  font:
    600 20px Barlow,
    sans-serif;
  letter-spacing: 0.05em;
}

.tactical-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  color: #d8e1d2;
  font-size: 9px;
  letter-spacing: 0.09em;
}

.tactical-legend > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tactical-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: none;
}

.map-you {
  background: #d7ff3e;
  clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%);
}

.map-friendly {
  background: #86d0de;
  border-radius: 50%;
}

.map-hostile {
  background: #eb7d73;
  transform: rotate(45deg);
}

.colorblind .map-friendly {
  background: #8daeff;
}

.colorblind .map-hostile {
  background: #edb35f;
}

.tactical-note {
  display: block;
  color: #92a491;
  font-size: 8px;
  letter-spacing: 0.12em;
  line-height: 1.9;
  margin-top: 20px;
}

.tactical-chart {
  position: relative;
  justify-self: end;
  width: min(100%, 560px, 54vh);
  aspect-ratio: 1;
  height: auto;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #dce6cf40;
  border-top: 1px solid #d7ff3e7a;
  background: #101922e8;
}

#tactical-map-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.tactical-north {
  position: absolute;
  top: 12px;
  left: 14px;
  font:
    600 15px Barlow,
    sans-serif;
  letter-spacing: 0.12em;
  color: #edf2d8;
  background: #0c151ce0;
  padding: 5px 7px;
  pointer-events: none;
}

.tactical-chart-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #09131bd9;
  padding: 7px;
  font-size: 8px;
  letter-spacing: 0.18em;
  color: #afbfaa;
  pointer-events: none;
}

.tactical-chart-caption i {
  width: 3px;
  height: 3px;
  background: var(--accent);
}

#tactical-map .result-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  width: 100%;
  margin-top: auto;
  flex-shrink: 0;
}

.tactical-key-hint {
  color: #afbfaa;
  font-size: 9px;
  letter-spacing: 0.09em;
}

.tactical-key-hint kbd {
  color: #edf2d8;
  border: 1px solid #dce6cf40;
  padding: 3px 5px;
  font: inherit;
}

@media (max-height: 760px) {
  #tactical-map {
    padding-block: 14px;
  }

  #tactical-map .results-shell {
    gap: 12px;
  }

  #tactical-map .page-brandbar {
    min-height: 38px;
    padding-bottom: 8px;
  }

  #tactical-map .page-brandbar img {
    height: 34px;
    width: 120px;
  }

  .tactical-brief {
    margin: 18px 0;
    gap: 12px;
  }

  #tactical-map-title {
    margin: 8px 0 12px;
  }
}

@media (max-width: 660px) and (orientation: portrait) {
  #tactical-map {
    padding: 16px 20px;
  }

  #tactical-map .page-brandbar > span {
    font-size: 7px;
    max-width: 135px;
  }

  #tactical-map .page-brandbar img {
    width: 110px;
    height: 32px;
  }

  .tactical-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 18px;
  }

  #tactical-map-title {
    font-size: 42px;
    margin: 5px 0 8px;
  }

  #tactical-map-title br {
    display: none;
  }

  #tactical-map-title br::after {
    content: " ";
  }

  .tactical-overview > p,
  .tactical-overview > .eyebrow,
  .tactical-note {
    display: none;
  }

  .tactical-brief {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
  }

  .tactical-brief > div {
    min-width: 0;
    padding-bottom: 6px;
  }

  .tactical-brief dt {
    font-size: 7px;
  }

  .tactical-brief dd {
    font-size: 14px;
  }

  .tactical-legend {
    gap: 12px;
    font-size: 8px;
  }

  .tactical-chart {
    width: min(100%, 39vh);
    justify-self: center;
  }

  #tactical-map .result-actions {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
  }

  #tactical-map .result-actions > button {
    width: auto;
    flex: 0 1 auto;
    min-height: 42px;
  }

  #tactical-map .tactical-key-hint {
    text-align: right;
  }

  #tactical-map .page-footer {
    font-size: 6px;
  }
}

@media (max-height: 550px) and (orientation: landscape) {
  #tactical-map {
    padding: 10px 4vw;
  }

  #tactical-map .results-shell {
    gap: 8px;
  }

  .tactical-content {
    grid-template-columns: minmax(170px, 0.7fr) minmax(0, 1.3fr);
    gap: 22px;
  }

  .tactical-chart {
    width: min(100%, 48vh);
  }

  #tactical-map-title {
    font-size: 40px;
    margin: 5px 0 8px;
  }

  .tactical-overview .eyebrow,
  .tactical-overview > p,
  .tactical-note {
    display: none;
  }

  .tactical-brief {
    margin: 10px 0;
    gap: 6px;
  }

  .tactical-brief > div {
    padding-bottom: 5px;
  }

  .tactical-brief dd {
    font-size: 15px;
    margin-top: 2px;
  }

  .tactical-legend {
    gap: 8px 12px;
    font-size: 8px;
  }

  #tactical-map .result-actions > button {
    min-height: 34px;
    padding: 8px 18px;
    font-size: 12px;
  }

  #tactical-map .page-brandbar {
    min-height: 28px;
    padding-bottom: 5px;
  }

  #tactical-map .page-brandbar img {
    width: 95px;
    height: 26px;
  }

  #tactical-map .page-brandbar > span {
    font-size: 7px;
  }

  #tactical-map .page-footer {
    display: none;
  }
}

/* Map information remains readable at every viewport size. */
#tactical-map
  :is(
    .page-brandbar > span,
    .page-footer,
    .tactical-brief dt,
    .tactical-legend,
    .tactical-chart-caption,
    .tactical-key-hint,
    .tactical-note,
    .tactical-overview > .eyebrow,
    .tactical-overview > p
  ) {
  font-size: clamp(11px, 0.75vw, 13px);
  line-height: 1.35;
  letter-spacing: 0.04em;
}

#tactical-map .page-footer {
  flex-wrap: wrap;
  gap: 6px 12px;
}

#tactical-map .tactical-content {
  overflow-x: hidden;
  overflow-y: auto;
}
