*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

#map {
  width: 100%;
  height: 100vh;
}

/* ── Header bar ─────────────────────────────────────────────────────────────── */
.header-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(12, 12, 20, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.header-title {
  font-size: 14px;
  font-weight: 650;
  color: #fff;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.header-sub {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  margin-left: 16px;
  flex-shrink: 0;
}

/* ── Group filter panel ─────────────────────────────────────────────────────── */
.filter-panel {
  position: fixed;
  top: 64px;
  right: 12px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 7px;
  width: 228px;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.11), 0 1px 4px rgba(0, 0, 0, 0.06);
}

.filter-label {
  width: 100%;
  font-size: 10px;
  font-weight: 700;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1px 2px 4px;
}

.filter-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 6px;
  border: none;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 650;
  color: #374151;
  letter-spacing: 0.01em;
  font-family: inherit;
  transition: background 0.12s ease, color 0.12s ease;
  flex-shrink: 0;
}

.filter-btn[data-group="all"] {
  min-width: 40px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.filter-btn:hover:not(.active) {
  background: rgba(0, 0, 0, 0.06);
}

.filter-btn.active {
  background: #111827;
  color: #fff;
}

/* ── Team marker ─────────────────────────────────────────────────────────────── */
.team-marker {
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: block;
}

.team-marker img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  display: block;
  transition: transform 0.2s ease;
  pointer-events: none; /* clicks go to parent div */
}

.team-marker:hover img {
  transform: scale(1.22);
}

/* ── Popup – override Mapbox defaults ────────────────────────────────────────── */
.team-popup .mapboxgl-popup-content {
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.07);
  border: 1px solid rgba(0, 0, 0, 0.07);
  overflow: hidden;
  min-width: 300px;
  max-width: 340px;
}

/* Tip arrow colour */
.team-popup.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip   { border-top-color:    #fff; }
.team-popup.mapboxgl-popup-anchor-top .mapboxgl-popup-tip      { border-bottom-color: #fff; }
.team-popup.mapboxgl-popup-anchor-left .mapboxgl-popup-tip     { border-right-color:  #fff; }
.team-popup.mapboxgl-popup-anchor-right .mapboxgl-popup-tip    { border-left-color:   #fff; }
.team-popup.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip  { border-top-color:    #fff; }
.team-popup.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip { border-top-color:    #fff; }
.team-popup.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip     { border-bottom-color: #fff; }
.team-popup.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip    { border-bottom-color: #fff; }

/* Close button */
.team-popup .mapboxgl-popup-close-button {
  top: 10px;
  right: 10px;
  font-size: 16px;
  color: #9CA3AF;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
  z-index: 2;
  transition: background 0.12s, color 0.12s;
}

.team-popup .mapboxgl-popup-close-button:hover {
  background: rgba(0, 0, 0, 0.07);
  color: #374151;
}

/* ── Popup inner content ─────────────────────────────────────────────────────── */
.popup-inner {
  position: relative;
}

.popup-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 40px 12px 14px; /* right: room for close btn */
}

.popup-flag {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.07);
  flex-shrink: 0;
  display: block;
}

.popup-meta {
  flex: 1;
  min-width: 0;
}

.popup-team-name {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popup-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.group-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}


/* Divider */
.popup-divider {
  height: 1px;
  background: #F3F4F6;
}

/* Rows */
.popup-section {
  padding: 11px 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popup-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.popup-icon {
  font-size: 15px;
  line-height: 1.35;
  flex-shrink: 0;
}

.popup-info {
  flex: 1;
  min-width: 0;
}

.info-name {
  font-size: 12.5px;
  font-weight: 650;
  color: #1F2937;
  line-height: 1.35;
}

.info-addr {
  font-size: 11px;
  color: #9CA3AF;
  line-height: 1.45;
  margin-top: 2px;
}

/* World Cup Debut tag */
.debut-tag {
  margin: 0 14px 13px;
  padding: 6px 10px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 650;
  color: #92400E;
}

/* ── Mapbox nav control positioning ─────────────────────────────────────────── */
.mapboxgl-ctrl-bottom-right {
  bottom: 28px;
  right: 12px;
}
