/* Globetta — веб-карта /map/. Свои стили страницы; шапка, кнопки, панели и тема — /style.css.
   Исходник — site/map/map.css; build.py копирует его в public/map/. */
:root {
  --map-land: #dde2e8;
  --map-line: #ffffff;
  --map-hover: #c9d0d9;
  --map-mine: var(--accent);
  --map-theirs: #ef8a17;
  --map-both: #7a4fd6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --map-land: #2b323b;
    --map-line: #0f1216;
    --map-hover: #3b4550;
    --map-theirs: #f5a142;
    --map-both: #a585f2;
  }
}

.map-page { padding-top: 28px; padding-bottom: 48px; }
.map-page [hidden] { display: none; }
.map-page h1 { margin-bottom: 0.3em; }
.map-page .lead { margin: 0 0 18px; }
.map-stats { margin: 0 0 10px; font-size: 1.3rem; font-weight: 700; min-height: 1.6em; }

/* Карта */
.map-frame {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.map-frame svg { display: block; width: 100%; height: auto; aspect-ratio: 2000 / 1040; }
.map-land, .map-c {
  fill: var(--map-land); stroke: var(--map-line); stroke-width: 0.6px; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.map-c { cursor: pointer; transition: fill 0.15s; }
@media (hover: hover) {
  .map-c:not([data-s]):hover { fill: var(--map-hover); }
  .map-c[data-s]:hover, .map-dot:hover { opacity: 0.82; }
}
.map-dot { display: none; stroke: var(--map-line); stroke-width: 1px; vector-effect: non-scaling-stroke; cursor: pointer; }
.map-dot[data-s] { display: inline; }
[data-s="mine"] { fill: var(--map-mine); background: var(--map-mine); }
[data-s="theirs"] { fill: var(--map-theirs); background: var(--map-theirs); }
[data-s="both"] { fill: var(--map-both); background: var(--map-both); }
.map-picked { margin: 8px 0 0; min-height: 1.6em; color: var(--muted); font-size: 0.95rem; }

/* Поиск и действия */
.map-tools { display: grid; gap: 16px; margin: 10px 0 18px; }
@media (min-width: 760px) {
  .map-tools { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  /* кнопки — вровень с полем поиска, под подписью; список находок их не сдвигает */
  .map-actions { padding-top: calc(0.95rem * 1.6 + 4px); }
}
.map-search { position: relative; min-width: 0; }
.map-page label { display: block; margin: 0 0 4px; font-weight: 600; font-size: 0.95rem; }
.map-page input {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.map-results {
  list-style: none; padding: 0; margin: 6px 0 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.map-results li + li { border-top: 1px solid var(--line); }
.map-results button {
  display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px;
  font: inherit; text-align: left; color: var(--text); background: none; border: 0; cursor: pointer;
}
.map-results button:hover { background: var(--bg); }
.map-results button[aria-pressed="true"]::after { content: "✓"; color: var(--map-mine); font-weight: 700; }
.map-none { padding: 10px 12px; color: var(--muted); }
.map-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.map-page button.btn { border: 0; font: inherit; cursor: pointer; }
.map-page button.btn-alt { border: 1px solid var(--line); }

/* Ссылка для друга */
.map-share { padding: 14px 18px 4px; margin: 0 0 18px; }
.map-share input { margin-bottom: 12px; }
.map-share #link { color: var(--muted); font-size: 0.9rem; text-overflow: ellipsis; }

/* Дуэль */
.map-duel { padding: 14px 18px 12px; margin: 0 0 16px; }
.map-duel h2 { margin: 0 0 10px; font-size: 1.15rem; overflow-wrap: anywhere; }
.map-legend { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.map-legend li { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.map-sw { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.map-duel summary { cursor: pointer; color: var(--accent); margin: 4px 0; }
.map-lists { display: grid; gap: 4px 18px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); font-size: 0.95rem; }
.map-lists h3 { margin: 0.8em 0 0.2em; font-size: 0.95rem; overflow-wrap: anywhere; }
.map-lists ul { margin: 0; padding-left: 1.1em; }
.map-linkbtn {
  margin-top: 8px; padding: 0; font: inherit; font-size: 0.95rem; color: var(--muted);
  background: none; border: 0; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}

.map-app { margin-top: 28px; }
.map-app .cta { margin: 8px 0 18px; }
