/* The conquest flag map page (views/flag-map.ejs). Layout and the few marks
   the map needs; every colour is a theme token except the holders' own
   swatches, which come from the API (utils/flagMap.js colorFor). */

.fm { display: grid; gap: 1rem; }
.fm .pgv2-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.fm .pgv2-head-text { min-width: 0; overflow-wrap: anywhere; }
.fm [hidden] { display: none !important; }

.fm-h { font-size: 1.05rem; margin: 0 0 0.75rem; }

.fm-live { align-self: center; white-space: nowrap; }
.fm-live[data-state="ok"] { color: var(--sk-success-text, var(--sk-text)); }
.fm-live[data-state="stale"] { color: var(--sk-warning-text, var(--sk-text)); }

.fm-swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 9999px;
  border: 2px solid var(--sk-surface);
  box-shadow: 0 0 0 1px var(--sk-border-2, var(--sk-border));
  flex: 0 0 auto;
  vertical-align: middle;
}

.fm-holder { margin: 0 0 0.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; overflow-wrap: anywhere; }
.fm-tally { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.fm-tally li { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.fm-tally-name { overflow-wrap: anywhere; }
.fm-tally b { font-variant-numeric: tabular-nums; }
.fm-teams { margin: 0.75rem 0 0; overflow-wrap: anywhere; }

.fm-map {
  position: relative;
  z-index: 0;
  height: min(70vh, 640px);
  min-height: 320px;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--sk-bg);
}
.fm-map .leaflet-container,
.fm-map.leaflet-container { background: var(--sk-bg); }
.fm-map canvas { max-width: none; }

/* A point's name on the map: text on a dark pill, readable over any tile. */
.fm-icon { background: none; border: 0; }
.fm-label {
  display: inline-block;
  transform: translate(-50%, -150%);
  padding: 0.1rem 0.45rem;
  border-radius: 0.35rem;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

.fm-point .cv2-row-name { align-items: center; }
.fm-point-holder { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.fm-point-holder small { color: var(--sk-muted); }

.fm-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.fm-events li { overflow-wrap: anywhere; }
.fm-events small { color: var(--sk-muted); margin-left: 0.35rem; }

.fm-foot { text-align: center; }
.fm-foot a { color: var(--sk-primary-text); }

@media (max-width: 40em) {
  .fm .cv2-row { flex-wrap: wrap; }
  .fm-point-holder { justify-content: flex-start; text-align: left; }
}

/* The DayZ flag flying (public/img/flags): beside a held point, an event and
   each team's name. */
.fm-flag {
  display: inline-block; width: 28px; height: 28px; object-fit: contain;
  vertical-align: middle; margin-right: 0.4rem; flex: 0 0 auto;
}

/* A point that just changed hands (public/js/flag-map.js): rings in the new
   holder's colour on the map, and a word in the list. The rings are only
   drawn when public/js/motion-v2.js says motion is on. */
.fm-capture-icon { background: none; border: 0; }
.fm-capture { position: absolute; left: 0; top: 0; width: 2.5rem; height: 2.5rem; margin: -1.25rem 0 0 -1.25rem; border-radius: 50%; border: 3px solid var(--fm-c, var(--sk-primary)); pointer-events: none; animation: fm-capture 1.2s ease-out 2 both; }
@keyframes fm-capture { 0% { scale: 0.3; opacity: 1; } 100% { scale: 2.6; opacity: 0; } }
.fm-captured { flex-basis: 100%; font-size: 0.8rem; font-weight: 700; color: var(--sk-success-text, var(--sk-text)); }
@media (prefers-reduced-motion: reduce) { .fm-capture { display: none; } }
