/* =============================================================================
   /compete/map — the full Fan Map (design_handoff_fan_map: 2a national +
   1a region zoom). Rides play-hub.css's --ph-* tokens (fm root has .ph);
   values here are the handoff's exact chrome specs.
   ============================================================================= */

/* Full-bleed like /explore (page-play already unlocks main.container). */

.fm-ctl { display: flex; align-items: center; gap: 16px; margin: 0 0 18px; flex-wrap: wrap; }
.fm-tabs {
  display: inline-flex; align-items: center; padding: 2px;
  border: 1px solid var(--ph-chrome); border-radius: 999px; flex: none;
}
.fm-tab {
  margin: 0 !important; padding: 5px 14px !important; width: auto !important;
  border: 0 !important; border-radius: 999px !important; background: transparent !important;
  color: var(--ph-t2) !important; font-size: 12px !important; font-weight: 700;
  cursor: pointer; font-family: inherit; line-height: 1.3; box-shadow: none !important;
  white-space: nowrap;
}
.fm-tab.is-on { background: var(--ph-solid) !important; color: var(--ph-solid-text) !important; }
.fm-hint { font-size: 11px; font-weight: 600; color: var(--ph-quiet); }

.fm-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px;
  align-items: start; margin: 0 0 40px;
}

/* ---- the map stage ---------------------------------------------------------- */
.fm-mapwrap { position: relative; }
#fmCanvas {
  display: block; width: 100%; aspect-ratio: 975 / 610;
  border-radius: 12px;
}

.fm-zoomctl {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  display: flex; flex-direction: column;
  background: var(--fm-card, #fff); border: 1px solid var(--ph-chrome);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 6px 20px rgba(16, 20, 24, 0.1);
}
.fm-zoomctl button {
  width: 32px !important; height: 32px; margin: 0 !important; padding: 0 !important;
  border: 0 !important; border-radius: 0 !important; background: transparent !important;
  color: var(--ph-ink) !important; font-size: 17px !important; font-weight: 600;
  line-height: 1; cursor: pointer; font-family: inherit; box-shadow: none !important;
}
.fm-zoomctl button:first-child { border-bottom: 1px solid var(--ph-row) !important; }
.fm-zoomctl button:hover { background: var(--ph-fill) !important; }

.fm-marquee {
  position: absolute; z-index: 5; pointer-events: none;
  border: 1.5px dashed rgba(16, 20, 24, 0.7); border-radius: 6px;
  background: rgba(16, 20, 24, 0.04);
}
.fm-marquee::before {
  content: attr(data-label);
  position: absolute; top: -26px; left: 0;
  padding: 3px 9px; border-radius: 6px;
  background: #101418; color: #fff;
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
}

.fm-tip {
  position: absolute; z-index: 4; transform: translate(-50%, -100%);
  padding: 4px 9px; border-radius: 7px; background: #101418; color: #fff;
  font-size: 11px; font-weight: 700; white-space: nowrap; pointer-events: none;
  box-shadow: 0 6px 18px rgba(16, 20, 24, 0.22);
}

/* ---- cell popover ------------------------------------------------------------ */
.fm-pop {
  position: absolute; z-index: 6; width: 262px; padding: 14px 16px;
  background: var(--fm-card, #fff); border: 1px solid var(--ph-chrome);
  border-radius: 12px; box-shadow: 0 14px 44px rgba(16, 20, 24, 0.16);
}
.fm-pop-x {
  position: absolute; top: 6px; right: 6px; width: 24px !important; height: 24px;
  margin: 0 !important; padding: 0 !important; border: 0 !important;
  border-radius: 6px !important; background: transparent !important;
  color: var(--ph-quiet) !important; font-size: 15px !important; line-height: 1;
  cursor: pointer; box-shadow: none !important; font-family: inherit;
}
.fm-pop-x:hover { color: var(--ph-ink) !important; }
.fm-pop-city { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; letter-spacing: -0.2px; }
.fm-pop-pill {
  display: inline-block; padding: 1px 7px; border: 1px solid #0084cc;
  border-radius: 999px; font-size: 8.5px; font-weight: 800; letter-spacing: 0.8px;
  text-transform: uppercase; color: #0084cc;
}
.fm-pop-sub { margin: 2px 0 10px; font-size: 11.5px; color: var(--ph-t3); }
.fm-pop-label {
  padding-top: 9px; border-top: 1px solid var(--ph-row);
  font-size: 9.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--ph-quiet); margin-bottom: 3px;
}
.fm-pop-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.fm-pop-row i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.fm-pop-cn { font-size: 12px; font-weight: 700; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-pop-h { font-size: 10.5px; color: var(--ph-quiet); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-pop-row b { margin-left: auto; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fm-pop-note { margin-top: 8px; font-size: 10px; color: var(--ph-ghost); }

/* ---- legend ------------------------------------------------------------------- */
.fm-legend {
  display: flex; align-items: center; justify-content: center; gap: 22px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ph-div);
  flex-wrap: wrap;
}
.fm-lg { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; color: var(--ph-t3); }
.fm-lg i { width: 10px; height: 10px; border-radius: 50%; flex: none; box-sizing: border-box; }
.fm-lg i.is-tracked { background: rgba(16, 20, 24, 0.22); }
.fm-lg i.is-claimed { background: #101418; border: 1.5px solid rgba(255, 255, 255, 0.9); }
.fm-lg i.is-contested { background: rgba(255, 255, 255, 0.85); border: 2.5px solid #0084cc; }
.fm-lg-cap { font-size: 11px; font-weight: 600; color: var(--ph-ghost); }

/* ---- standings ------------------------------------------------------------------ */
.fm-standhead.si-shead { margin-bottom: 10px; }
.fm-standings { max-width: 720px; margin-bottom: 40px; }
.fm-tbl { grid-template-columns: 34px minmax(0, 1.8fr) 100px 70px; }

/* ---- how-claims modal -------------------------------------------------------------- */
.fm-how {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(16, 20, 24, 0.4); backdrop-filter: blur(2px);
}
.fm-how-card {
  position: relative; width: 100%; max-width: 420px; padding: 22px 24px;
  background: var(--fm-card, #fff); border: 1px solid var(--ph-chrome);
  border-radius: 14px; box-shadow: 0 20px 60px rgba(16, 20, 24, 0.25);
}
.fm-how-x {
  position: absolute; top: 8px; right: 8px; width: 26px !important; height: 26px;
  margin: 0 !important; padding: 0 !important; border: 0 !important;
  border-radius: 7px !important; background: transparent !important;
  color: var(--ph-quiet) !important; font-size: 16px !important; line-height: 1;
  cursor: pointer; box-shadow: none !important; font-family: inherit;
}
.fm-how-title { font-size: 16px; font-weight: 800; letter-spacing: -0.2px; margin-bottom: 8px; }
.fm-how-card p { margin: 0 0 10px; font-size: 13px; line-height: 1.55; color: var(--ph-t2); }
.fm-how-card .ph-cta { margin-top: 4px; }

/* ---- theme surfaces ------------------------------------------------------------------ */
.fm { --fm-card: #1e2028; }
html.si-light body.si-themed .fm { --fm-card: #fff; }

/* ---- responsive ---------------------------------------------------------------------- */
@media (max-width: 1120px) {
  .fm-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 720px) {
  .fm-hint { display: none; }
}
