.map-app {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  background: var(--bg);
  color: var(--ink);
}

.map-tabs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  justify-content: stretch;
  flex: 0 0 auto;
  padding: 0 0.35rem 0 0;
  border-bottom: 2px solid var(--seal);
  background: var(--paper);
  overflow: visible;
  white-space: nowrap;
}

.map-tabs-center {
  display: flex;
  grid-column: 2;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.map-tabs-views {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
}

.map-tabs-chips {
  display: flex;
  flex: 0 0 auto;
  border-left: 1px solid var(--line);
}

.map-tabs-views button,
.map-tabs-ext {
  font: inherit;
  color: inherit;
  min-height: 2.2rem;
  padding: 0 1rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  margin-bottom: -2px;
  flex: 0 0 auto;
}

.map-tabs-ext {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.map-tabs-ext:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.map-tabs-views button.is-active {
  font-weight: 700;
  border-bottom-color: var(--seal);
  color: var(--seal);
}

.map-chrome-toggle {
  display: none;
  grid-column: 3;
  justify-self: end;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  min-height: 2.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.map-chrome-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.map-chrome-toggle svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 59.99rem) {
  .map-chrome-toggle {
    display: inline-flex;
  }

  html.is-map-chrome-compact .site-header {
    display: none;
  }

  html.is-map-chrome-compact .map-dossier-copy,
  html.is-map-chrome-compact .map-dossier-art {
    display: none;
  }

  html.is-map-chrome-compact .map-dossier {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 0.12rem 0;
    gap: 0;
  }

  html.is-map-chrome-compact .map-chrome-toggle svg {
    transform: rotate(180deg);
  }
}

.map-dossier {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0.55rem 0.85rem;
  align-items: start;
  flex: 0 0 auto;
  padding: 0.5rem 1rem 0.45rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.map-dossier-art {
  display: block;
  width: 56px;
  height: 76px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.map-dossier-copy {
  min-width: 0;
}

.map-dossier-copy h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.12;
  letter-spacing: 0.01em;
  margin: 0 0 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-dossier-copy .map-lead {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  margin: 0 0 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-dossier-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--faint);
}

.map-dossier .ad-slot--map {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  padding: 0.4rem 0 0.15rem;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  min-height: 50px;
}

.map-dossier .ad-slot--map .ad-label {
  margin-bottom: 0.15rem;
}

@media (min-width: 700px) {
  .map-dossier {
    grid-template-columns: 64px minmax(0, 1fr);
    padding: 0.55rem 1.1rem 0.5rem;
  }

  .map-dossier-art {
    width: 64px;
    height: 86px;
  }

  .map-dossier-copy h1 {
    font-size: 1.55rem;
  }
}

@media (min-width: 960px) {
  .map-dossier {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
  }

  .map-dossier .ad-slot--map {
    grid-column: auto;
    justify-self: end;
    align-self: center;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    min-height: 0;
    background: transparent;
  }
}

.map-about > .ad-slot--inarticle {
  margin: 0.5rem 1.1rem 0.85rem;
}

.map-shell {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.map-panel {
  flex: 0 0 22rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  padding: 0.85rem 1.1rem 1.1rem;
  border-right: 2px solid var(--seal);
  background: var(--paper);
  overflow: auto;
}

.map-search input,
.map-check,
.map-layer-actions button,
.map-styles button,
.map-tools button,
.map-filters-toggle {
  font: inherit;
  color: inherit;
}

.map-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.map-panel-top {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.map-panel-close,
.map-panel-scrim {
  display: none;
}

.map-search label {
  display: block;
}

.map-search input {
  width: 100%;
  min-height: var(--touch);
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  background: var(--search-bg);
  color: var(--ink);
}

.map-progress {
  font-size: 0.82rem;
  color: var(--faint);
}

.map-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2rem;
  font-size: 0.88rem;
}

.map-styles,
.map-layer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.map-styles button,
.map-layer-actions button,
.map-tools button,
.map-filters-toggle {
  min-height: 2.4rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  background: var(--bg-2);
  cursor: pointer;
}

.map-styles button.is-active,
.map-cat input:focus-visible + span,
.map-styles button:focus-visible,
.map-tools button:focus-visible,
.map-filters-toggle:focus-visible,
.map-layer-actions button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.map-styles button.is-active {
  background: var(--seal);
  color: var(--seal-ink);
  border-color: var(--seal);
  font-weight: 700;
}

.map-filters {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-bottom: 1rem;
}

.map-group h2 {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--seal);
}

.map-cat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.map-cat .map-swatch {
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  line-height: 0;
}

.map-cat .map-swatch svg,
.map-cat .map-swatch img {
  display: block;
  width: 100%;
  height: 100%;
}

.map-cat .map-count {
  margin-left: auto;
  color: var(--faint);
  font-size: 0.78rem;
}

.map-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  background: #0d2b4f;
}

.map-board {
  position: absolute;
  inset: 0;
  /* Leaflet panes usam z-index 200–1000. Sem um contexto aqui, eles
     competem com o drawer de filtros no mobile e o painel abre atrás da placa. */
  z-index: 0;
}

.map-board.leaflet-container {
  width: 100%;
  height: 100%;
  background: transparent;
  font: inherit;
  color: inherit;
}

.map-pin {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
}

.map-pin svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-pin-img img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-pin-canvas {
  position: absolute;
  left: 0;
  top: 0;
}

.map-swatch img {
  display: block;
  width: 100%;
  height: 100%;
}

.map-pin.is-found {
  opacity: 0.42;
}

.map-hud-coords {
  position: absolute;
  left: 0.8rem;
  bottom: calc(0.8rem + var(--safe-bottom));
  z-index: 1100;
  margin: 0;
  padding: 0.35rem 0.6rem;
  background: rgb(13 13 13 / 0.82);
  border: 1px solid rgb(239 230 212 / 0.28);
  color: #efe6d4;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  pointer-events: none;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.7);
}

.map-hud-coords[hidden] {
  display: none;
}

.map-tools {
  position: absolute;
  right: 0.8rem;
  bottom: calc(0.8rem + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  /* Sem isto o + e o − esticam ate a largura do "Reset view" e comem um quarto
     da tela num telefone. */
  align-items: flex-end;
  gap: 0.35rem;
  z-index: 1100;
}

.map-tools button {
  min-width: 2.6rem;
}

.map-filters-toggle {
  display: none;
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 1100;
  background: var(--bg-2);
  border-color: var(--seal);
}

.map-leaflet-popup .leaflet-popup-content-wrapper {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--seal);
  border-radius: 0;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.35);
}

.map-leaflet-popup .leaflet-popup-tip {
  background: var(--seal);
}

.map-leaflet-popup.is-below.leaflet-popup {
  margin-bottom: 0;
  margin-top: 20px;
}

.map-leaflet-popup.is-below .leaflet-popup-tip-container {
  top: 0;
  bottom: auto;
  margin-top: -20px;
  transform: rotate(180deg);
}

.map-leaflet-popup .leaflet-popup-content {
  margin: 0;
}

.map-popup-media {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #1a2428;
  cursor: zoom-in;
}

.map-popup-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  pointer-events: none;
}

.map-popup-credit {
  display: block;
  margin: 0;
  padding: 0.28rem 0.55rem 0.35rem;
  background: #12110f;
  color: #8a8378;
  font-size: 0.68rem;
  line-height: 1.3;
}

.map-popup-media.is-mosaic {
  cursor: default;
}

.map-popup-media.is-mosaic img:not([src]) {
  opacity: 0;
}

.map-popup-media[hidden] {
  display: none;
}

.map-leaflet-popup h2 {
  font-size: 1.05rem;
  margin: 0.7rem 0.95rem 0.35rem;
}

.map-leaflet-popup p,
.map-leaflet-popup button {
  font-size: 0.88rem;
}

.map-leaflet-popup p {
  margin: 0 0.95rem 0.4rem;
}

.map-facts {
  display: grid;
  gap: 0;
  margin: 0.15rem 0 0;
}

.map-facts div {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.map-facts dt {
  color: var(--faint);
  font-size: 0.78rem;
}

.map-facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.map-leaflet-popup .map-facts {
  margin: 0 0.95rem 0.5rem;
}

.map-index-body .map-facts {
  margin: 0.2rem 0 0;
}

.map-index-row .map-facts div {
  grid-template-columns: 6.4rem minmax(0, 1fr);
  padding: 0.2rem 0;
}

.map-index-row .map-facts div:last-child {
  border-bottom: 0;
}

.map-popup-coords {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.map-popup-sheet,
.map-popup-sheet-only {
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  font-size: 0.78rem;
}

.map-coord-key {
  color: var(--muted);
  margin-inline-end: 0.4rem;
  user-select: none;
  -webkit-user-select: none;
}

/* user-select: all faz um clique pegar o par inteiro, sem arrastar o rótulo. */
.map-coord-val {
  user-select: all;
  -webkit-user-select: all;
  cursor: copy;
  padding: 0.05rem 0.3rem;
  border-bottom: 1px dashed var(--line);
  transition: background-color 140ms var(--ease);
}

.map-coord-val:hover {
  background: var(--bg-2);
  border-bottom-color: var(--seal);
}

.map-coord-val.is-copied {
  background: var(--seal);
  color: var(--seal-ink);
  border-bottom-color: var(--seal);
}

.leaflet-popup-pane {
  z-index: 800;
}

.map-popup-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.7rem;
  margin: 0.2rem 0.95rem 0.7rem;
}

.map-popup-foot p {
  margin: 0 0 0.15rem;
}

.map-popup-foot p:last-child {
  margin-bottom: 0;
}

.map-popup-found {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--faint);
  cursor: pointer;
}

.map-popup-found:hover {
  color: var(--ink);
  border-color: var(--seal);
}

.map-popup-found.is-found {
  background: var(--seal);
  color: var(--seal-ink);
  border-color: var(--seal);
}

@media (pointer: coarse) {
  .map-popup-found {
    width: 2.6rem;
    height: 2.6rem;
  }
}

.leaflet-control-attribution {
  background: rgb(13 13 13 / 0.72) !important;
  color: #efe6d4;
  font-size: 0.7rem;
}

.leaflet-control-attribution a {
  color: #efe6d4;
}

.map-hits {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  z-index: 8;
  max-height: 14rem;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
}

.map-hits button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.map-hits button:hover,
.map-hits button:focus-visible {
  background: var(--bg-2);
}

.map-loading {
  color: var(--faint);
}

.map-index {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: var(--paper);
  overflow: hidden;
}

.map-app.is-index .map-stage,
.map-app.is-about .map-stage,
.map-app.is-maps .map-stage,
.map-app.is-games .map-stage {
  display: none;
}

.map-app.is-index .map-index {
  display: flex;
}

.map-about,
.map-plates,
.map-games {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: var(--paper);
  overflow: auto;
}

.map-app.is-about .map-about,
.map-app.is-maps .map-plates,
.map-app.is-games .map-games {
  display: flex;
}

.map-app.is-about .map-panel,
.map-app.is-maps .map-panel,
.map-app.is-games .map-panel,
.map-app.is-about .map-index,
.map-app.is-maps .map-index,
.map-app.is-games .map-index,
.map-app.is-index .map-about,
.map-app.is-index .map-plates,
.map-app.is-index .map-games,
.map-app.is-games .map-about,
.map-app.is-games .map-plates,
.map-app.is-about .map-games,
.map-app.is-maps .map-games,
.map-app.is-about .map-filters-toggle,
.map-app.is-maps .map-filters-toggle,
.map-app.is-games .map-filters-toggle,
.map-app.is-index .map-filters-toggle {
  display: none;
}

.map-about-head,
.map-about-body {
  padding: 1rem 1.1rem 0.75rem;
}

.map-stats {
  padding: 0.35rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.map-stats dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 0 0 0.75rem;
}

.map-stats dt {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--seal);
}

.map-stats dd {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}

.map-stats-cats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
}

.map-stats-cats li {
  color: var(--muted);
}

.map-stats-cats b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.map-about-body {
  padding-bottom: 2.5rem;
}

.map-about-body {
  padding-bottom: 2.5rem;
}

.map-about-body p {
  margin: 0 0 0.9rem;
}

.map-about-head h2,
.map-about-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  text-transform: uppercase;
}

.map-about-body h2 {
  margin-top: 1.6rem;
}

.map-games-roster {
  list-style: none;
  margin: 0;
  padding: 0.35rem 1.1rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.9rem;
}

.map-games-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.map-games-card-art {
  display: block;
  aspect-ratio: 16 / 10;
  background: #1a2428;
  overflow: hidden;
}

.map-games-card-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-games-card-art.is-empty {
  background: linear-gradient(160deg, rgb(196 92 58 / 0.35), #1a2428 58%);
}

.map-games-card-copy {
  display: block;
  padding: 0.7rem 0.8rem 0.85rem;
}

.map-games-more {
  padding: 0 1.1rem 1.4rem;
}

.map-games-more h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.25rem;
}

.map-games-more p {
  margin: 0 0 0.7rem;
  color: var(--muted);
}

.map-games-more .map-games-roster {
  padding: 0;
}

.map-games-card:hover,
.map-games-card:focus-visible {
  border-color: var(--seal);
}

.map-games-card:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.map-games-card-copy strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.map-games-card-copy span {
  display: block;
  margin: 0.3rem 0 0.45rem;
  color: var(--muted);
}

.map-games-card-copy em {
  font-style: normal;
  color: var(--seal);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-games.is-play .map-about-head,
.map-games.is-play .map-games-roster,
.map-games.is-play .map-games-more,
.map-games.is-play .map-trail {
  display: none;
}

.map-app.is-about .map-about,
.map-app.is-maps .map-plates,
.map-app.is-games:not(.is-spot) .map-games {
  align-items: center;
}

.map-app.is-about .map-about > *,
.map-app.is-maps .map-plates > *,
.map-app.is-games:not(.is-spot) .map-games > * {
  width: min(48rem, 100%);
  box-sizing: border-box;
}

.map-games-round,
.map-games-end,
.map-games-spare {
  width: min(22rem, 100%);
  margin-inline: auto;
}

.map-games-meta,
.map-games-wait,
.map-games-verdict,
.map-games-spare {
  color: var(--muted);
  margin: 0 0 0.85rem;
}

.map-games-name,
.map-games-blurb,
.map-games-end h3 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.map-games-art {
  margin: 0 auto 0.85rem;
  width: min(100%, 22rem);
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.map-games-art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 13rem;
  object-fit: contain;
  background: var(--bg);
}

.map-games-spot-ask {
  margin: 0 0 0.65rem;
  color: var(--muted);
}

.map-app.is-games .map-shell {
  position: relative;
}

.map-app.is-games .map-stage {
  display: block;
  position: absolute;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
}

.map-app.is-games.is-spot .map-stage {
  visibility: visible;
  pointer-events: auto;
}

.map-app.is-games.is-spot .map-games {
  position: absolute;
  left: 0.6rem;
  top: 0.6rem;
  z-index: 1080;
  display: block;
  flex: none;
  width: min(22rem, calc(100% - 1.2rem));
  max-height: min(46vh, 24rem);
  overflow: auto;
  height: auto;
  background: transparent;
  pointer-events: none;
}

.map-app.is-games.is-spot .map-games-play {
  pointer-events: auto;
  margin: 0;
  padding: 0.7rem 0.8rem 0.8rem;
  background: var(--paper);
  border: 2px solid var(--seal);
}

.map-app.is-games.is-spot .map-games-art {
  width: min(100%, 16rem);
  margin-bottom: 0.5rem;
}

.map-app.is-games.is-spot .map-games-art img {
  max-height: 7.5rem;
}

.map-games-choices {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.map-games-choice {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.map-games-choice:hover:not(:disabled),
.map-games-choice:focus-visible:not(:disabled) {
  border-color: var(--seal);
}

.map-games-choice:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.map-games-choice.is-right {
  border-color: var(--seal);
  color: var(--seal);
}

.map-games-choice.is-wrong {
  opacity: 0.55;
}

.map-games-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}

.map-games-actions button {
  font: inherit;
  color: inherit;
  min-height: 2.4rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  background: var(--bg-2);
  cursor: pointer;
}

.map-games-actions button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

@media (min-width: 700px) {
  .map-games-choices {
    grid-template-columns: 1fr 1fr;
  }
}

.map-plate-list {
  list-style: none;
  margin: 0;
  padding: 0.85rem 1.1rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.9rem;
}

.map-plate-list li {
  padding: 0;
  border: 0;
}

.map-plate-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.map-plate-card:hover,
.map-plate-card:focus-visible {
  border-color: var(--seal);
}

.map-plate-card.is-current {
  border-color: var(--seal);
}

.map-plate-art {
  display: block;
  aspect-ratio: 16 / 10;
  background: #1a2428;
  overflow: hidden;
}

.map-plate-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-plate-art img:not([src]) {
  visibility: hidden;
}

.map-plate-card strong {
  display: block;
  padding: 0.7rem 0.8rem 0.25rem;
  font-weight: 700;
  color: var(--seal);
}

.map-plate-card.is-current strong {
  color: var(--ink);
}

.map-plate-sum {
  display: block;
  padding: 0 0.8rem 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.map-index-head {
  padding: 1rem 1.1rem 0.35rem;
}

.map-index-head h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  text-transform: uppercase;
}

.map-index-count {
  color: var(--faint);
  font-size: 0.85rem;
}

.map-index-tools {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0.55rem 1.1rem 0.7rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.map-index-tools input,
.map-index-tools select {
  font: inherit;
  color: inherit;
  min-height: var(--touch);
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  background: var(--search-bg);
}

.map-index-tools label {
  flex: 1 1 12rem;
}

.map-index-tools input,
.map-index-tools select {
  width: 100%;
}

.map-index-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.map-trail {
  flex: 0 0 auto;
  padding: 0.7rem 1.1rem 1rem;
  border-top: 1px solid var(--line);
}

.map-trail .crumbs ol {
  margin: 0;
  font-size: 0.8rem;
}

.map-index-list {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}

.map-index-row {
  display: flex;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
  list-style: none;
}

.map-index-thumb {
  flex: 0 0 7.5rem;
  width: 7.5rem;
  height: 4.2rem;
  padding: 0;
  border: 1px solid var(--line);
  background: #1a2428;
  cursor: zoom-in;
  overflow: hidden;
}

.map-index-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.map-index-thumb.is-empty,
.map-index-thumb.is-mosaic {
  background: #1a2428;
  cursor: default;
}

.map-index-thumb.is-mosaic img:not([src]) {
  opacity: 0;
}

.map-index-body {
  min-width: 0;
  flex: 1 1 auto;
}

.map-index-go {
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

.map-index-go:hover,
.map-index-go:focus-visible {
  color: var(--seal);
}

.map-index-sum {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.map-index-meta {
  margin: 0.3rem 0 0;
  color: var(--faint);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.map-index-row[hidden] {
  display: none;
}

.map-gallery {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: none;
  width: 100%;
  height: 100%;
}

.map-gallery::backdrop {
  background: rgb(10 8 6 / 0.82);
}

.map-gallery-frame {
  position: relative;
  width: min(72rem, 94vw);
  margin: 4vh auto;
  padding: 1rem 1.1rem 1.2rem;
  background: var(--paper);
  border: 2px solid var(--seal);
  color: var(--ink);
}

.map-gallery-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 68vh;
  object-fit: contain;
  background: #1a2428;
}

.map-gallery-frame h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  text-transform: uppercase;
  margin: 0.8rem 0 0.35rem;
}

.map-gallery-close,
.map-gallery-nav button {
  font: inherit;
  min-height: 2.4rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: inherit;
  cursor: pointer;
}

.map-gallery-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
}

.place-pin {
  background: transparent;
  border: 0;
}

.leaflet-container {
  background: var(--bg);
  font: inherit;
}

html[data-theme="dark"] .map-board .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) saturate(0.35) brightness(0.92);
}

.map-gallery-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

@media (max-width: 879px) {
  .map-app {
    display: flex;
    flex-direction: column;
  }

  .map-shell {
    position: relative;
    display: block;
    flex: 1 1 auto;
    min-height: 0;
  }

  .map-panel {
    position: absolute;
    /* Acima da placa isolada (0) e dos panes do Leaflet (até 1000);
       acima do véu (1040), abaixo das ferramentas (1100). */
    z-index: 1050;
    inset: 0 auto 0 0;
    width: min(22rem, 92vw);
    transform: translateX(-105%);
    transition: transform var(--dur) var(--ease);
    box-shadow: 8px 0 24px rgb(0 0 0 / 0.35);
  }

  .map-app.is-panel .map-panel {
    transform: none;
  }

  .map-panel-scrim {
    position: absolute;
    inset: 0;
    z-index: 1040;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgb(0 0 0 / 0.55);
    cursor: pointer;
  }

  .map-app.is-panel .map-panel-scrim {
    display: block;
  }

  .map-app.is-panel .map-stage {
    z-index: 0;
  }

  .map-panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.4rem;
    min-width: 2.4rem;
    min-height: 2.4rem;
    padding: 0;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: inherit;
    font: inherit;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
  }

  .map-panel-close:focus-visible {
    outline: none;
    box-shadow: var(--focus);
  }

  .map-stage {
    height: 100%;
  }

  .map-app.is-index .map-stage,
  .map-app.is-about .map-stage,
  .map-app.is-maps .map-stage {
    display: none;
  }

  .map-app.is-games .map-stage {
    display: block;
    position: absolute;
    inset: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .map-app.is-games.is-spot .map-stage {
    visibility: visible;
    pointer-events: auto;
  }

  .map-app.is-index .map-panel-scrim,
  .map-app.is-about .map-panel-scrim,
  .map-app.is-maps .map-panel-scrim,
  .map-app.is-games .map-panel-scrim {
    display: none;
  }

  .map-app.is-index .map-index,
  .map-app.is-about .map-about,
  .map-app.is-maps .map-plates,
  .map-app.is-games .map-games {
    display: flex;
    height: 100%;
  }

  .map-app.is-games.is-spot .map-games {
    display: block;
    height: auto;
  }

  .map-filters-toggle {
    display: inline-flex;
    align-items: center;
  }

  .map-app.is-panel .map-filters-toggle {
    display: none;
  }
}

/* No dedo, caixa de marcar e linha de categoria precisam de area de toque. */
@media (pointer: coarse) {
  .map-cat,
  .map-check {
    min-height: 2.4rem;
  }

  .map-cat input,
  .map-check input {
    width: 1.1rem;
    height: 1.1rem;
  }
}

.map-panel-read {
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
  font-size: 0.92rem;
}
.map-panel-read h2 { font-size: 1.05rem; }
.map-styles[hidden] { display: none !important; }

.place-pin {
  background: none;
  border: 0;
}

.place-pin-svg {
  display: block;
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.45));
}

.place-cluster {
  background: none;
  border: 0;
}

.place-cluster-count {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid #f4f5f3;
  background: var(--seal);
  color: var(--seal-ink);
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 1px 6px rgb(0 0 0 / 0.4);
}

.map-popup-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0.95rem 0.7rem !important;
}

.map-route {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.map-route:hover {
  border-color: var(--seal);
  color: var(--seal);
}

.map-index-intro {
  padding: 0 1rem 1.1rem;
}

.map-index-intro h2 {
  margin-top: 1.4rem;
  font-family: var(--font-display);
  font-weight: 500;
}

.map-index-intro p {
  color: var(--muted);
}

.map-index-faq {
  padding: 0 1rem 1.4rem;
}

.map-index-count {
  margin: 0;
  padding: 0 1rem 0.6rem;
  color: var(--faint);
  font-size: 0.82rem;
}
